/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * WNSimGuideMainFrame.java
 *
 * Created on 23 Ιουν 2009, 2:23:07 μμ
 */
package gui;

import utilities.DrawingBean;
import simulation.GUIOptionManager;
import maps.MapsXMLManager;
import base.node.NodeArchBean;
import config.ConfigXMLManager;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.Label;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.File;
import java.io.IOException;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.JPanel;

/**
 * The main frame that guides the user through the simulation settings
 * @author Arvanitis Ioannis
 */
public class WNSimGuideMainFrame extends javax.swing.JFrame {

    private final int MULT = 1;
    private Vector<NodeArchBean> v = new Vector<NodeArchBean>();

    /** 
     * Creates new form WNSimGuideMainFrame
     */
    public WNSimGuideMainFrame() {
        initComponents();
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        Dimension screensize = toolkit.getScreenSize();
        Dimension framesize = this.getSize();
        int x = (int) (screensize.getWidth() - this.getWidth()) / 2;
        int y = (int) (screensize.getHeight() - this.getHeight()) / 2;
        this.setLocation(x, y);
        this.setVisible(true);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroupTerrain = new javax.swing.ButtonGroup();
        buttonGroupNodeCategories = new javax.swing.ButtonGroup();
        buttonGroupRadioSpace = new javax.swing.ButtonGroup();
        buttonGroupRadioAttenuationModel = new javax.swing.ButtonGroup();
        buttonGroupNodeMobilityModel = new javax.swing.ButtonGroup();
        buttonGroupNodeMobilityModelRPGM = new javax.swing.ButtonGroup();
        jPanelOptions = new javax.swing.JPanel();
        jTabbedPaneOptions = new javax.swing.JTabbedPane();
        jPanelGeneral = new javax.swing.JPanel();
        jLabelGeneralSimTime = new javax.swing.JLabel();
        jTextFieldGeneralSimTimeMin = new javax.swing.JTextField();
        jLabelGeneralCommOffset = new javax.swing.JLabel();
        jTextFieldGeneralCommOffset = new javax.swing.JTextField();
        jLabelGeneralTotalNodes = new javax.swing.JLabel();
        jTextFieldGeneralTotalNodes = new javax.swing.JTextField();
        jLabelGeneralSimTimeSec = new javax.swing.JLabel();
        jTextFieldGeneralSimTimeSec = new javax.swing.JTextField();
        jLabelGeneralSimTimeMin1 = new javax.swing.JLabel();
        jCheckBoxGeneralNetworkingDistrSim = new javax.swing.JCheckBox();
        jTextFieldGeneralNetworkingDistrSimIP = new javax.swing.JTextField();
        jLabelGeneralNetworkingDistrSimIP = new javax.swing.JLabel();
        jLabelGeneralFrequency = new javax.swing.JLabel();
        jTextFieldGeneralFrequency = new javax.swing.JTextField();
        jLabelGeneralTimeScale = new javax.swing.JLabel();
        jLabelGeneralTimeScale1secSim = new javax.swing.JLabel();
        jTextFieldGeneralTimeScale1secField = new javax.swing.JTextField();
        jLabelGeneralTimeScale1secField = new javax.swing.JLabel();
        jLabelGeneralTimeScaleTranception = new javax.swing.JLabel();
        jLabelGeneralTimeScaleProcessing = new javax.swing.JLabel();
        jTextFieldGeneralTimeScaleTranception = new javax.swing.JTextField();
        jTextFieldGeneralTimeScaleProcessing = new javax.swing.JTextField();
        jLabelGeneralComment = new javax.swing.JLabel();
        jLabelGeneralNetworking = new javax.swing.JLabel();
        jSeparatorGeneral = new javax.swing.JSeparator();
        jPanelTerrain = new javax.swing.JPanel();
        jButtonTerrainDefinition = new javax.swing.JButton();
        jRadioButtonTerrainDefinitionLoadMap = new javax.swing.JRadioButton();
        jRadioButtonTerrainDefinitionCreateMap = new javax.swing.JRadioButton();
        jLabelTerrainCapacity = new javax.swing.JLabel();
        jPanelMap = new javax.swing.JPanel();
        jLabelMap = new javax.swing.JLabel();
        jLabelTerrainDefinition = new javax.swing.JLabel();
        jRadioButtonTerrainDefinitionEmptySpace = new javax.swing.JRadioButton();
        jTextFieldTerrainCapacityHeightMeters = new javax.swing.JTextField();
        jTextFieldTerrainCapacityWidthMeters = new javax.swing.JTextField();
        jLabelTerrainCapacityWidthMeters = new javax.swing.JLabel();
        jLabelTerrainCapacityHeightMeters = new javax.swing.JLabel();
        jTextFieldTerrainFragmentationWidthCellsObstacles = new javax.swing.JTextField();
        jTextFieldTerrainFragmentationHeightCellsObstacles = new javax.swing.JTextField();
        jLabelTerrainFragmentationHeightCellsObstacles = new javax.swing.JLabel();
        jLabelTerrainFragmentationWidthCellsObstacles = new javax.swing.JLabel();
        jLabelTerrainFragmentation = new javax.swing.JLabel();
        jPanelNodes = new javax.swing.JPanel();
        jLabelPositionNodes = new javax.swing.JLabel();
        jButtonPositionNodesSet = new javax.swing.JButton();
        jLabelNodeCategories = new javax.swing.JLabel();
        jRadioButtonNodeCategoriesSame = new javax.swing.JRadioButton();
        jRadioButtonNodeCategoriesDiff = new javax.swing.JRadioButton();
        jButtonNodeArchSetParam = new javax.swing.JButton();
        jSeparatorNode = new javax.swing.JSeparator();
        jLabelNodeArch = new javax.swing.JLabel();
        jCheckBoxNodesArchMobility = new javax.swing.JCheckBox();
        jLabelNodeArchPower = new javax.swing.JLabel();
        jTextFieldNodeArchPowerV = new javax.swing.JTextField();
        jLabelNodesArchDaemonInterval = new javax.swing.JLabel();
        jTextFieldNodesArchDaemonInterval = new javax.swing.JTextField();
        jLabelNodesArchDaemonIntervalSec = new javax.swing.JLabel();
        jProgressBarNodeCategories = new javax.swing.JProgressBar();
        jComboBoxNodeCategoriesDiff = new javax.swing.JComboBox();
        jLabelNodeArchNumberOfNodes = new javax.swing.JLabel();
        jTextFieldNodeArchNumberOfNodes = new javax.swing.JTextField();
        jLabelNodeArchNodesLeft = new javax.swing.JLabel();
        jLabelNodeArchECPMovement = new javax.swing.JLabel();
        jTextFieldNodeArchECPMovement = new javax.swing.JTextField();
        jLabelNodeArchECPTransmission = new javax.swing.JLabel();
        jTextFieldNodeArchECPTransmission = new javax.swing.JTextField();
        jLabelNodeArchECPIdleState = new javax.swing.JLabel();
        jTextFieldNodeArchECPIdleState = new javax.swing.JTextField();
        jLabelNodeArchECPProcessing = new javax.swing.JLabel();
        jTextFieldNodeArchECPProcessing = new javax.swing.JTextField();
        jLabelNodeArchAntennaThres = new javax.swing.JLabel();
        jLabelNodeArchECPReception = new javax.swing.JLabel();
        jTextFieldNodeArchECPReception = new javax.swing.JTextField();
        jTextFieldNodeArchAntennaThres = new javax.swing.JTextField();
        jLabelNodeArchPowerV = new javax.swing.JLabel();
        jTextFieldNodeArchPowermAh = new javax.swing.JTextField();
        jLabelNodeArchPowermAh = new javax.swing.JLabel();
        jLabelNodeArchAntennaRadPow = new javax.swing.JLabel();
        jTextFieldNodeArchAntennaRadPow = new javax.swing.JTextField();
        jLabelNodeMobilityModel = new javax.swing.JLabel();
        jRadioButtonNodeMobModRandomWaypoint = new javax.swing.JRadioButton();
        jRadioButtonNodeMobModRPGM = new javax.swing.JRadioButton();
        jComboBoxNodeMobModMaxVelocity = new javax.swing.JComboBox();
        jLabelNodeMobModMaxVelocity = new javax.swing.JLabel();
        jRadioButtonNodeMobModRPGMInplace = new javax.swing.JRadioButton();
        jRadioButtonNodeMobModRPGMOverlap = new javax.swing.JRadioButton();
        jLabelNodeMobModGrid = new javax.swing.JLabel();
        jComboBoxNodeMobModGrid = new javax.swing.JComboBox();
        jLabelNodeArchComment = new javax.swing.JLabel();
        jPanelRadio = new javax.swing.JPanel();
        jLabelRadioSpace = new javax.swing.JLabel();
        jRadioButtonRadioSpaceClearSky = new javax.swing.JRadioButton();
        jRadioButtonRadioSpaceRain = new javax.swing.JRadioButton();
        jButtonRadioSpace = new javax.swing.JButton();
        jTextFieldRadioSpaceRainHeavy = new javax.swing.JTextField();
        jLabelRadioSpaceRainHeavy = new javax.swing.JLabel();
        jLabelRadioSpaceRainLight = new javax.swing.JLabel();
        jTextFieldRadioSpaceRainLight = new javax.swing.JTextField();
        jLabelRadioFragmentation = new javax.swing.JLabel();
        jTextFieldRadioFragmentationWidthCellsRain = new javax.swing.JTextField();
        jLabelRadioFragmentationHeightCellsRain = new javax.swing.JLabel();
        jTextFieldRadioFragmentationHeightCellsRain = new javax.swing.JTextField();
        jLabelRadioFragmentationWidthCellsRain = new javax.swing.JLabel();
        jSeparatorRadio = new javax.swing.JSeparator();
        jLabelRadioAttMod = new javax.swing.JLabel();
        jRadioButtonRadioAttModFSP = new javax.swing.JRadioButton();
        jRadioButtonRadioAttModFriisBasic = new javax.swing.JRadioButton();
        jRadioButtonRadioAttModFriisEmp = new javax.swing.JRadioButton();
        jLabel2 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jTextField2 = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jTextField3 = new javax.swing.JTextField();
        jPanelRouting = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jRadioButton1 = new javax.swing.JRadioButton();
        jLabelLogo = new javax.swing.JLabel();
        menuBar = new javax.swing.JMenuBar();
        fileMenu = new javax.swing.JMenu();
        openMenuItem = new javax.swing.JMenuItem();
        saveMenuItem = new javax.swing.JMenuItem();
        saveAsMenuItem = new javax.swing.JMenuItem();
        exitMenuItem = new javax.swing.JMenuItem();
        simulationMenu = new javax.swing.JMenu();
        jMenuItemSimulationRun = new javax.swing.JMenuItem();
        helpMenu = new javax.swing.JMenu();
        contentsMenuItem = new javax.swing.JMenuItem();
        aboutMenuItem = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("WNSim Guide Options - Οδηγός Προσομοίωσης Ασυρμάτων Δικτύων");
        setMinimumSize(new java.awt.Dimension(600, 400));
        setResizable(false);

        jLabelGeneralSimTime.setFont(new java.awt.Font("Tahoma", 2, 11));
        jLabelGeneralSimTime.setText("Simulation time :");

        jTextFieldGeneralSimTimeMin.setHorizontalAlignment(javax.swing.JTextField.TRAILING);
        jTextFieldGeneralSimTimeMin.setText("5");
        jTextFieldGeneralSimTimeMin.setToolTipText("minutes");
        jTextFieldGeneralSimTimeMin.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldGeneralSimTimeMinMouseClicked(evt);
            }
        });

        jLabelGeneralCommOffset.setFont(new java.awt.Font("Tahoma", 2, 11));
        jLabelGeneralCommOffset.setText("Port communication offset :");

        jTextFieldGeneralCommOffset.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldGeneralCommOffset.setText("30000");
        jTextFieldGeneralCommOffset.setToolTipText("use ports in [1024,65535]");
        jTextFieldGeneralCommOffset.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldGeneralCommOffsetMouseClicked(evt);
            }
        });

        jLabelGeneralTotalNodes.setFont(new java.awt.Font("Tahoma", 2, 11));
        jLabelGeneralTotalNodes.setText("Total number of nodes :");

        jTextFieldGeneralTotalNodes.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldGeneralTotalNodes.setText("100");
        jTextFieldGeneralTotalNodes.setToolTipText("");
        jTextFieldGeneralTotalNodes.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldGeneralTotalNodesMouseClicked(evt);
            }
        });

        jLabelGeneralSimTimeSec.setText("\"");

        jTextFieldGeneralSimTimeSec.setHorizontalAlignment(javax.swing.JTextField.TRAILING);
        jTextFieldGeneralSimTimeSec.setText("0");
        jTextFieldGeneralSimTimeSec.setToolTipText("seconds");
        jTextFieldGeneralSimTimeSec.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldGeneralSimTimeSecMouseClicked(evt);
            }
        });

        jLabelGeneralSimTimeMin1.setText("'");

        jCheckBoxGeneralNetworkingDistrSim.setText("Simulate the broker on different server");
        jCheckBoxGeneralNetworkingDistrSim.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBoxGeneralNetworkingDistrSimActionPerformed(evt);
            }
        });

        jTextFieldGeneralNetworkingDistrSimIP.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldGeneralNetworkingDistrSimIP.setEnabled(false);

        jLabelGeneralNetworkingDistrSimIP.setText("IP:");
        jLabelGeneralNetworkingDistrSimIP.setEnabled(false);

        jLabelGeneralFrequency.setFont(new java.awt.Font("Tahoma", 2, 11));
        jLabelGeneralFrequency.setText("Frequency used (MHz) :");

        jTextFieldGeneralFrequency.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldGeneralFrequency.setText("2400");
        jTextFieldGeneralFrequency.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldGeneralFrequencyMouseClicked(evt);
            }
        });

        jLabelGeneralTimeScale.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabelGeneralTimeScale.setText("Time scale :");

        jLabelGeneralTimeScale1secSim.setText("1 sec in simulation =");

        jTextFieldGeneralTimeScale1secField.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldGeneralTimeScale1secField.setText("3600");
        jTextFieldGeneralTimeScale1secField.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldGeneralTimeScale1secFieldMouseClicked(evt);
            }
        });

        jLabelGeneralTimeScale1secField.setText("sec in field");

        jLabelGeneralTimeScaleTranception.setText("tranception delay (sec)* :");

        jLabelGeneralTimeScaleProcessing.setText("processing delay (sec)* :");

        jTextFieldGeneralTimeScaleTranception.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldGeneralTimeScaleTranception.setText("2");
        jTextFieldGeneralTimeScaleTranception.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldGeneralTimeScaleTranceptionMouseClicked(evt);
            }
        });

        jTextFieldGeneralTimeScaleProcessing.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldGeneralTimeScaleProcessing.setText("5");
        jTextFieldGeneralTimeScaleProcessing.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldGeneralTimeScaleProcessingMouseClicked(evt);
            }
        });

        jLabelGeneralComment.setFont(new java.awt.Font("Tahoma", 0, 10));
        jLabelGeneralComment.setText("* field time");

        jLabelGeneralNetworking.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabelGeneralNetworking.setText("Networking :");

        jSeparatorGeneral.setOrientation(javax.swing.SwingConstants.VERTICAL);

        javax.swing.GroupLayout jPanelGeneralLayout = new javax.swing.GroupLayout(jPanelGeneral);
        jPanelGeneral.setLayout(jPanelGeneralLayout);
        jPanelGeneralLayout.setHorizontalGroup(
            jPanelGeneralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelGeneralLayout.createSequentialGroup()
                .addGroup(jPanelGeneralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelGeneralLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanelGeneralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabelGeneralTimeScale)
                            .addGroup(jPanelGeneralLayout.createSequentialGroup()
                                .addComponent(jLabelGeneralFrequency)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jTextFieldGeneralFrequency, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanelGeneralLayout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addGroup(jPanelGeneralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(jPanelGeneralLayout.createSequentialGroup()
                                        .addComponent(jLabelGeneralTimeScaleProcessing)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextFieldGeneralTimeScaleProcessing, 0, 0, Short.MAX_VALUE))
                                    .addGroup(jPanelGeneralLayout.createSequentialGroup()
                                        .addComponent(jLabelGeneralTimeScaleTranception)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextFieldGeneralTimeScaleTranception))
                                    .addGroup(jPanelGeneralLayout.createSequentialGroup()
                                        .addComponent(jLabelGeneralTimeScale1secSim)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextFieldGeneralTimeScale1secField, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabelGeneralTimeScale1secField)))
                        .addGap(14, 14, 14))
                    .addGroup(jPanelGeneralLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(jLabelGeneralCommOffset, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(10, 10, 10)
                        .addComponent(jTextFieldGeneralCommOffset, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelGeneralLayout.createSequentialGroup()
                        .addGroup(jPanelGeneralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanelGeneralLayout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(jLabelGeneralTotalNodes, javax.swing.GroupLayout.DEFAULT_SIZE, 160, Short.MAX_VALUE))
                            .addGroup(jPanelGeneralLayout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(jLabelGeneralSimTime, javax.swing.GroupLayout.DEFAULT_SIZE, 160, Short.MAX_VALUE)))
                        .addGap(10, 10, 10)
                        .addGroup(jPanelGeneralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelGeneralLayout.createSequentialGroup()
                                .addComponent(jTextFieldGeneralSimTimeMin, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabelGeneralSimTimeMin1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jTextFieldGeneralSimTimeSec, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabelGeneralSimTimeSec, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jTextFieldGeneralTotalNodes, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanelGeneralLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabelGeneralComment)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparatorGeneral, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(16, 16, 16)
                .addGroup(jPanelGeneralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelGeneralNetworking)
                    .addGroup(jPanelGeneralLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addGroup(jPanelGeneralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelGeneralLayout.createSequentialGroup()
                                .addGap(21, 21, 21)
                                .addComponent(jLabelGeneralNetworkingDistrSimIP)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextFieldGeneralNetworkingDistrSimIP, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jCheckBoxGeneralNetworkingDistrSim, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addGap(62, 62, 62))
        );

        jPanelGeneralLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabelGeneralCommOffset, jLabelGeneralFrequency, jLabelGeneralSimTime, jLabelGeneralTotalNodes});

        jPanelGeneralLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jTextFieldGeneralCommOffset, jTextFieldGeneralFrequency, jTextFieldGeneralTotalNodes});

        jPanelGeneralLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabelGeneralTimeScaleProcessing, jLabelGeneralTimeScaleTranception});

        jPanelGeneralLayout.setVerticalGroup(
            jPanelGeneralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelGeneralLayout.createSequentialGroup()
                .addGroup(jPanelGeneralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelGeneralLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addGroup(jPanelGeneralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabelGeneralCommOffset, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldGeneralCommOffset, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(10, 10, 10)
                        .addGroup(jPanelGeneralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabelGeneralTotalNodes, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldGeneralTotalNodes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(10, 10, 10)
                        .addGroup(jPanelGeneralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelGeneralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jTextFieldGeneralSimTimeMin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabelGeneralSimTime, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jLabelGeneralSimTimeMin1, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldGeneralSimTimeSec, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelGeneralSimTimeSec, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanelGeneralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelGeneralFrequency)
                            .addComponent(jTextFieldGeneralFrequency, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addComponent(jLabelGeneralTimeScale)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelGeneralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelGeneralTimeScale1secSim)
                            .addComponent(jTextFieldGeneralTimeScale1secField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelGeneralTimeScale1secField))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelGeneralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelGeneralTimeScaleTranception)
                            .addComponent(jTextFieldGeneralTimeScaleTranception, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelGeneralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelGeneralTimeScaleProcessing)
                            .addComponent(jTextFieldGeneralTimeScaleProcessing, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanelGeneralLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabelGeneralNetworking)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jCheckBoxGeneralNetworkingDistrSim)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelGeneralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelGeneralNetworkingDistrSimIP)
                            .addComponent(jTextFieldGeneralNetworkingDistrSimIP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(30, 30, 30)
                .addComponent(jLabelGeneralComment)
                .addContainerGap())
            .addComponent(jSeparatorGeneral, javax.swing.GroupLayout.DEFAULT_SIZE, 285, Short.MAX_VALUE)
        );

        jPanelGeneralLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabelGeneralTimeScale1secField, jLabelGeneralTimeScale1secSim, jTextFieldGeneralTimeScale1secField});

        jPanelGeneralLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabelGeneralCommOffset, jLabelGeneralFrequency, jLabelGeneralSimTime, jLabelGeneralTotalNodes});

        jPanelGeneralLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jTextFieldGeneralCommOffset, jTextFieldGeneralFrequency, jTextFieldGeneralTotalNodes});

        jPanelGeneralLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jCheckBoxGeneralNetworkingDistrSim, jLabelGeneralNetworkingDistrSimIP});

        jTabbedPaneOptions.addTab("General", jPanelGeneral);

        jButtonTerrainDefinition.setText("Browse/Create");
        jButtonTerrainDefinition.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonTerrainDefinitionActionPerformed(evt);
            }
        });

        buttonGroupTerrain.add(jRadioButtonTerrainDefinitionLoadMap);
        jRadioButtonTerrainDefinitionLoadMap.setText("Load existed map");
        jRadioButtonTerrainDefinitionLoadMap.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButtonTerrainDefinitionLoadMapActionPerformed(evt);
            }
        });

        buttonGroupTerrain.add(jRadioButtonTerrainDefinitionCreateMap);
        jRadioButtonTerrainDefinitionCreateMap.setText("Create/Modify maps");
        jRadioButtonTerrainDefinitionCreateMap.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButtonTerrainDefinitionCreateMapActionPerformed(evt);
            }
        });

        jLabelTerrainCapacity.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabelTerrainCapacity.setText("Terrain capacity :");

        jLabelMap.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelMap.setText("No map selected");
        jLabelMap.setAlignmentY(0.0F);
        jLabelMap.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 102, 0)));

        javax.swing.GroupLayout jPanelMapLayout = new javax.swing.GroupLayout(jPanelMap);
        jPanelMap.setLayout(jPanelMapLayout);
        jPanelMapLayout.setHorizontalGroup(
            jPanelMapLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelMapLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabelMap, javax.swing.GroupLayout.DEFAULT_SIZE, 367, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanelMapLayout.setVerticalGroup(
            jPanelMapLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabelMap, javax.swing.GroupLayout.PREFERRED_SIZE, 285, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        jLabelTerrainDefinition.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabelTerrainDefinition.setText("Terrain definition :");

        buttonGroupTerrain.add(jRadioButtonTerrainDefinitionEmptySpace);
        jRadioButtonTerrainDefinitionEmptySpace.setSelected(true);
        jRadioButtonTerrainDefinitionEmptySpace.setText("Use empty space as a map");
        jRadioButtonTerrainDefinitionEmptySpace.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButtonTerrainDefinitionEmptySpaceActionPerformed(evt);
            }
        });

        jTextFieldTerrainCapacityHeightMeters.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldTerrainCapacityHeightMeters.setText("500");
        jTextFieldTerrainCapacityHeightMeters.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldTerrainCapacityHeightMetersMouseClicked(evt);
            }
        });

        jTextFieldTerrainCapacityWidthMeters.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldTerrainCapacityWidthMeters.setText("800");
        jTextFieldTerrainCapacityWidthMeters.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldTerrainCapacityWidthMetersMouseClicked(evt);
            }
        });

        jLabelTerrainCapacityWidthMeters.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelTerrainCapacityWidthMeters.setText("width (meters) :");

        jLabelTerrainCapacityHeightMeters.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelTerrainCapacityHeightMeters.setText("height (meters) :");

        jTextFieldTerrainFragmentationWidthCellsObstacles.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldTerrainFragmentationWidthCellsObstacles.setText("20");
        jTextFieldTerrainFragmentationWidthCellsObstacles.setEnabled(false);
        jTextFieldTerrainFragmentationWidthCellsObstacles.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldTerrainFragmentationWidthCellsObstaclesMouseClicked(evt);
            }
        });

        jTextFieldTerrainFragmentationHeightCellsObstacles.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldTerrainFragmentationHeightCellsObstacles.setText("20");
        jTextFieldTerrainFragmentationHeightCellsObstacles.setEnabled(false);
        jTextFieldTerrainFragmentationHeightCellsObstacles.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldTerrainFragmentationHeightCellsObstaclesMouseClicked(evt);
            }
        });

        jLabelTerrainFragmentationHeightCellsObstacles.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelTerrainFragmentationHeightCellsObstacles.setText("height :");
        jLabelTerrainFragmentationHeightCellsObstacles.setEnabled(false);

        jLabelTerrainFragmentationWidthCellsObstacles.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelTerrainFragmentationWidthCellsObstacles.setText("width :");
        jLabelTerrainFragmentationWidthCellsObstacles.setEnabled(false);

        jLabelTerrainFragmentation.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabelTerrainFragmentation.setText("Terrain fragmentation :");
        jLabelTerrainFragmentation.setEnabled(false);

        javax.swing.GroupLayout jPanelTerrainLayout = new javax.swing.GroupLayout(jPanelTerrain);
        jPanelTerrain.setLayout(jPanelTerrainLayout);
        jPanelTerrainLayout.setHorizontalGroup(
            jPanelTerrainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelTerrainLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelTerrainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jRadioButtonTerrainDefinitionEmptySpace, javax.swing.GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelTerrainLayout.createSequentialGroup()
                        .addComponent(jLabelTerrainDefinition)
                        .addGap(59, 59, 59))
                    .addComponent(jButtonTerrainDefinition, javax.swing.GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE)
                    .addComponent(jLabelTerrainCapacity, javax.swing.GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE)
                    .addComponent(jRadioButtonTerrainDefinitionCreateMap, javax.swing.GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE)
                    .addComponent(jRadioButtonTerrainDefinitionLoadMap, javax.swing.GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE)
                    .addGroup(jPanelTerrainLayout.createSequentialGroup()
                        .addGroup(jPanelTerrainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabelTerrainCapacityWidthMeters, javax.swing.GroupLayout.DEFAULT_SIZE, 98, Short.MAX_VALUE)
                            .addComponent(jLabelTerrainCapacityHeightMeters, javax.swing.GroupLayout.DEFAULT_SIZE, 98, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelTerrainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextFieldTerrainCapacityHeightMeters, javax.swing.GroupLayout.DEFAULT_SIZE, 60, Short.MAX_VALUE)
                            .addComponent(jTextFieldTerrainCapacityWidthMeters, javax.swing.GroupLayout.DEFAULT_SIZE, 60, Short.MAX_VALUE)))
                    .addComponent(jLabelTerrainFragmentation)
                    .addGroup(jPanelTerrainLayout.createSequentialGroup()
                        .addComponent(jLabelTerrainFragmentationWidthCellsObstacles, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextFieldTerrainFragmentationWidthCellsObstacles, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)
                        .addComponent(jLabelTerrainFragmentationHeightCellsObstacles)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextFieldTerrainFragmentationHeightCellsObstacles, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelMap, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jPanelTerrainLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jTextFieldTerrainFragmentationHeightCellsObstacles, jTextFieldTerrainFragmentationWidthCellsObstacles});

        jPanelTerrainLayout.setVerticalGroup(
            jPanelTerrainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelTerrainLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabelTerrainDefinition)
                .addGap(4, 4, 4)
                .addComponent(jRadioButtonTerrainDefinitionEmptySpace)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jRadioButtonTerrainDefinitionLoadMap)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jRadioButtonTerrainDefinitionCreateMap)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonTerrainDefinition)
                .addGap(18, 18, 18)
                .addComponent(jLabelTerrainCapacity)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelTerrainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelTerrainCapacityWidthMeters, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldTerrainCapacityWidthMeters, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelTerrainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelTerrainCapacityHeightMeters)
                    .addComponent(jTextFieldTerrainCapacityHeightMeters, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE)
                .addComponent(jLabelTerrainFragmentation)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelTerrainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelTerrainFragmentationWidthCellsObstacles, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldTerrainFragmentationWidthCellsObstacles, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelTerrainFragmentationHeightCellsObstacles)
                    .addComponent(jTextFieldTerrainFragmentationHeightCellsObstacles, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(31, 31, 31))
            .addGroup(jPanelTerrainLayout.createSequentialGroup()
                .addComponent(jPanelMap, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanelTerrainLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabelTerrainCapacityHeightMeters, jLabelTerrainCapacityWidthMeters, jLabelTerrainFragmentationHeightCellsObstacles, jLabelTerrainFragmentationWidthCellsObstacles, jTextFieldTerrainCapacityHeightMeters, jTextFieldTerrainCapacityWidthMeters, jTextFieldTerrainFragmentationHeightCellsObstacles, jTextFieldTerrainFragmentationWidthCellsObstacles});

        jTabbedPaneOptions.addTab("Terrain", jPanelTerrain);

        jLabelPositionNodes.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabelPositionNodes.setText("Position nodes :");

        jButtonPositionNodesSet.setText("Set positions");
        jButtonPositionNodesSet.setEnabled(false);
        jButtonPositionNodesSet.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonPositionNodesSetActionPerformed(evt);
            }
        });

        jLabelNodeCategories.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabelNodeCategories.setText("Node categories :");

        buttonGroupNodeCategories.add(jRadioButtonNodeCategoriesSame);
        jRadioButtonNodeCategoriesSame.setSelected(true);
        jRadioButtonNodeCategoriesSame.setText("Use same nodes");
        jRadioButtonNodeCategoriesSame.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButtonNodeCategoriesSameActionPerformed(evt);
            }
        });

        buttonGroupNodeCategories.add(jRadioButtonNodeCategoriesDiff);
        jRadioButtonNodeCategoriesDiff.setText("Use different kind of nodes");
        jRadioButtonNodeCategoriesDiff.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButtonNodeCategoriesDiffActionPerformed(evt);
            }
        });

        jButtonNodeArchSetParam.setText("Set parameters");
        jButtonNodeArchSetParam.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonNodeArchSetParamActionPerformed(evt);
            }
        });

        jSeparatorNode.setOrientation(javax.swing.SwingConstants.VERTICAL);

        jLabelNodeArch.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabelNodeArch.setText("Node architecture :");

        jCheckBoxNodesArchMobility.setText("mobility enabled");
        jCheckBoxNodesArchMobility.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBoxNodesArchMobilityActionPerformed(evt);
            }
        });

        jLabelNodeArchPower.setText("Power details :");

        jTextFieldNodeArchPowerV.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldNodeArchPowerV.setText("1.2");

        jLabelNodesArchDaemonInterval.setText("Daemon activation interval :");

        jTextFieldNodesArchDaemonInterval.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldNodesArchDaemonInterval.setText("60");
        jTextFieldNodesArchDaemonInterval.setToolTipText("time interval within which daemons sleep and do not update the state of nodes");
        jTextFieldNodesArchDaemonInterval.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldNodesArchDaemonIntervalMouseClicked(evt);
            }
        });

        jLabelNodesArchDaemonIntervalSec.setText("\"");

        jProgressBarNodeCategories.setMaximum(1);
        jProgressBarNodeCategories.setName(""); // NOI18N
        jProgressBarNodeCategories.setOpaque(true);
        jProgressBarNodeCategories.setStringPainted(true);

        jComboBoxNodeCategoriesDiff.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "2", "3", "4", "5", "6", "7", "8", "9", "10" }));
        jComboBoxNodeCategoriesDiff.setEnabled(false);
        jComboBoxNodeCategoriesDiff.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jComboBoxNodeCategoriesDiffItemStateChanged(evt);
            }
        });

        jLabelNodeArchNumberOfNodes.setText("Number of nodes in this category :");
        jLabelNodeArchNumberOfNodes.setEnabled(false);

        jTextFieldNodeArchNumberOfNodes.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldNodeArchNumberOfNodes.setEnabled(false);

        jLabelNodeArchECPMovement.setText("consumption / movement (mWh) :");
        jLabelNodeArchECPMovement.setEnabled(false);

        jTextFieldNodeArchECPMovement.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldNodeArchECPMovement.setText("5");
        jTextFieldNodeArchECPMovement.setEnabled(false);
        jTextFieldNodeArchECPMovement.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldNodeArchECPMovementMouseClicked(evt);
            }
        });

        jLabelNodeArchECPTransmission.setText("consumption / transmission (mWh) :");

        jTextFieldNodeArchECPTransmission.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldNodeArchECPTransmission.setText("3");
        jTextFieldNodeArchECPTransmission.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldNodeArchECPTransmissionMouseClicked(evt);
            }
        });

        jLabelNodeArchECPIdleState.setText("consumption in idle state per hour* (mWh) :");

        jTextFieldNodeArchECPIdleState.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldNodeArchECPIdleState.setText("2");
        jTextFieldNodeArchECPIdleState.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldNodeArchECPIdleStateMouseClicked(evt);
            }
        });

        jLabelNodeArchECPProcessing.setText("consumption / message processing (mWh) :");

        jTextFieldNodeArchECPProcessing.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldNodeArchECPProcessing.setText("2");
        jTextFieldNodeArchECPProcessing.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldNodeArchECPProcessingMouseClicked(evt);
            }
        });

        jLabelNodeArchAntennaThres.setText("Antenna's activation threshold (dBm) :");

        jLabelNodeArchECPReception.setText("consumption / reception (mWh) :");

        jTextFieldNodeArchECPReception.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldNodeArchECPReception.setText("1");
        jTextFieldNodeArchECPReception.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldNodeArchECPReceptionMouseClicked(evt);
            }
        });

        jTextFieldNodeArchAntennaThres.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldNodeArchAntennaThres.setText("-70");
        jTextFieldNodeArchAntennaThres.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldNodeArchAntennaThresMouseClicked(evt);
            }
        });

        jLabelNodeArchPowerV.setText("V");

        jTextFieldNodeArchPowermAh.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldNodeArchPowermAh.setText("500");

        jLabelNodeArchPowermAh.setText("mAh");

        jLabelNodeArchAntennaRadPow.setText("Antenna's radiated power (dBm) :");

        jTextFieldNodeArchAntennaRadPow.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldNodeArchAntennaRadPow.setText("0");
        jTextFieldNodeArchAntennaRadPow.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldNodeArchAntennaRadPowMouseClicked(evt);
            }
        });

        jLabelNodeMobilityModel.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabelNodeMobilityModel.setText("Mobility model :");

        buttonGroupNodeMobilityModel.add(jRadioButtonNodeMobModRandomWaypoint);
        jRadioButtonNodeMobModRandomWaypoint.setSelected(true);
        jRadioButtonNodeMobModRandomWaypoint.setText("Random waypoint");
        jRadioButtonNodeMobModRandomWaypoint.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButtonNodeMobModRandomWaypointActionPerformed(evt);
            }
        });

        buttonGroupNodeMobilityModel.add(jRadioButtonNodeMobModRPGM);
        jRadioButtonNodeMobModRPGM.setText("Reference point group mobility");
        jRadioButtonNodeMobModRPGM.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButtonNodeMobModRPGMActionPerformed(evt);
            }
        });

        jComboBoxNodeMobModMaxVelocity.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2", "3", "4", "5" }));

        jLabelNodeMobModMaxVelocity.setText("max velocity :");

        jRadioButtonNodeMobModRPGMInplace.setSelected(true);
        jRadioButtonNodeMobModRPGMInplace.setText("in-place");
        jRadioButtonNodeMobModRPGMInplace.setEnabled(false);

        jRadioButtonNodeMobModRPGMOverlap.setText("overlap");
        jRadioButtonNodeMobModRPGMOverlap.setEnabled(false);

        jLabelNodeMobModGrid.setText("grid :");
        jLabelNodeMobModGrid.setEnabled(false);

        jComboBoxNodeMobModGrid.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "2", "3", "4", "5", "6", "8", "10", "15", "20", "25", "30", "40", "50" }));
        jComboBoxNodeMobModGrid.setEnabled(false);

        jLabelNodeArchComment.setFont(new java.awt.Font("Tahoma", 0, 10));
        jLabelNodeArchComment.setText("* field time");

        javax.swing.GroupLayout jPanelNodesLayout = new javax.swing.GroupLayout(jPanelNodes);
        jPanelNodes.setLayout(jPanelNodesLayout);
        jPanelNodesLayout.setHorizontalGroup(
            jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelNodesLayout.createSequentialGroup()
                .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanelNodesLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelNodesLayout.createSequentialGroup()
                                .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(jRadioButtonNodeCategoriesSame, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jRadioButtonNodeCategoriesDiff, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabelNodeCategories, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jComboBoxNodeCategoriesDiff, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jProgressBarNodeCategories, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanelNodesLayout.createSequentialGroup()
                        .addGap(44, 44, 44)
                        .addComponent(jButtonNodeArchSetParam, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelNodesLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabelPositionNodes, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButtonPositionNodesSet, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelNodesLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabelNodeMobilityModel)
                            .addGroup(jPanelNodesLayout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jRadioButtonNodeMobModRPGM)
                                    .addComponent(jRadioButtonNodeMobModRandomWaypoint)
                                    .addGroup(jPanelNodesLayout.createSequentialGroup()
                                        .addGap(21, 21, 21)
                                        .addComponent(jRadioButtonNodeMobModRPGMInplace)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jRadioButtonNodeMobModRPGMOverlap))
                                    .addGroup(jPanelNodesLayout.createSequentialGroup()
                                        .addComponent(jLabelNodeMobModMaxVelocity)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jComboBoxNodeMobModMaxVelocity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jLabelNodeMobModGrid)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jComboBoxNodeMobModGrid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jSeparatorNode, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelNodeArch)
                    .addGroup(jPanelNodesLayout.createSequentialGroup()
                        .addComponent(jLabelNodeArchPower)
                        .addGap(18, 18, 18)
                        .addComponent(jTextFieldNodeArchPowerV, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabelNodeArchPowerV)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jTextFieldNodeArchPowermAh, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabelNodeArchPowermAh))
                    .addGroup(jPanelNodesLayout.createSequentialGroup()
                        .addComponent(jLabelNodeArchNumberOfNodes)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextFieldNodeArchNumberOfNodes, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabelNodeArchNodesLeft, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelNodesLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabelNodeArchECPProcessing, javax.swing.GroupLayout.DEFAULT_SIZE, 210, Short.MAX_VALUE)
                            .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(jLabelNodeArchECPTransmission, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabelNodeArchECPIdleState, javax.swing.GroupLayout.Alignment.LEADING))
                            .addComponent(jLabelNodeArchECPReception, javax.swing.GroupLayout.DEFAULT_SIZE, 210, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextFieldNodeArchECPTransmission, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldNodeArchECPIdleState, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldNodeArchECPProcessing, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldNodeArchECPReception, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanelNodesLayout.createSequentialGroup()
                        .addComponent(jLabelNodesArchDaemonInterval, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextFieldNodesArchDaemonInterval, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabelNodesArchDaemonIntervalSec, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelNodesLayout.createSequentialGroup()
                        .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelNodesLayout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(jCheckBoxNodesArchMobility)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabelNodeArchECPMovement))
                            .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addGroup(jPanelNodesLayout.createSequentialGroup()
                                    .addComponent(jLabelNodeArchAntennaThres)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jTextFieldNodeArchAntennaThres))
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanelNodesLayout.createSequentialGroup()
                                    .addComponent(jLabelNodeArchAntennaRadPow)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jTextFieldNodeArchAntennaRadPow, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGap(4, 4, 4)
                        .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextFieldNodeArchECPMovement, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelNodeArchComment))))
                .addGap(16, 16, 16))
        );

        jPanelNodesLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jTextFieldNodeArchECPIdleState, jTextFieldNodeArchECPProcessing, jTextFieldNodeArchECPReception, jTextFieldNodeArchECPTransmission});

        jPanelNodesLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabelNodeArchAntennaRadPow, jLabelNodeArchAntennaThres});

        jPanelNodesLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabelNodeArchECPIdleState, jLabelNodeArchECPProcessing, jLabelNodeArchECPReception, jLabelNodeArchECPTransmission});

        jPanelNodesLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jTextFieldNodeArchAntennaRadPow, jTextFieldNodeArchAntennaThres});

        jPanelNodesLayout.setVerticalGroup(
            jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelNodesLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelNodesLayout.createSequentialGroup()
                        .addComponent(jLabelNodeArch)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelNodeArchNumberOfNodes, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldNodeArchNumberOfNodes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelNodeArchNodesLeft, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(3, 3, 3)
                        .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelNodeArchPower, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldNodeArchPowerV, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelNodeArchPowerV, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldNodeArchPowermAh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelNodeArchPowermAh, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jCheckBoxNodesArchMobility)
                            .addComponent(jLabelNodeArchECPMovement)
                            .addComponent(jTextFieldNodeArchECPMovement, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanelNodesLayout.createSequentialGroup()
                        .addComponent(jLabelNodeCategories)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jRadioButtonNodeCategoriesSame)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jRadioButtonNodeCategoriesDiff)
                            .addComponent(jComboBoxNodeCategoriesDiff, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jProgressBarNodeCategories, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelNodesLayout.createSequentialGroup()
                        .addComponent(jButtonNodeArchSetParam)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelPositionNodes)
                            .addComponent(jButtonPositionNodesSet))
                        .addGap(9, 9, 9)
                        .addComponent(jLabelNodeMobilityModel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jRadioButtonNodeMobModRandomWaypoint)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jRadioButtonNodeMobModRPGM)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jRadioButtonNodeMobModRPGMInplace, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jRadioButtonNodeMobModRPGMOverlap, javax.swing.GroupLayout.PREFERRED_SIZE, 13, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelNodeMobModMaxVelocity)
                            .addComponent(jComboBoxNodeMobModMaxVelocity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelNodeMobModGrid)
                            .addComponent(jComboBoxNodeMobModGrid, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanelNodesLayout.createSequentialGroup()
                        .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelNodesLayout.createSequentialGroup()
                                .addComponent(jTextFieldNodeArchECPIdleState, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(4, 4, 4)
                                .addComponent(jTextFieldNodeArchECPTransmission, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextFieldNodeArchECPReception, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jTextFieldNodeArchECPProcessing, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabelNodeArchECPProcessing)))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelNodesLayout.createSequentialGroup()
                                .addComponent(jLabelNodeArchECPIdleState)
                                .addGap(4, 4, 4)
                                .addComponent(jLabelNodeArchECPTransmission)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabelNodeArchECPReception)
                                .addGap(24, 24, 24)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE)
                        .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelNodesArchDaemonInterval, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldNodesArchDaemonInterval, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelNodesArchDaemonIntervalSec, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelNodeArchAntennaRadPow)
                            .addComponent(jTextFieldNodeArchAntennaRadPow, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelNodesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelNodeArchAntennaThres)
                            .addComponent(jTextFieldNodeArchAntennaThres, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelNodeArchComment))))
                .addContainerGap())
            .addComponent(jSeparatorNode, javax.swing.GroupLayout.DEFAULT_SIZE, 288, Short.MAX_VALUE)
        );

        jPanelNodesLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jButtonNodeArchSetParam, jRadioButtonNodeCategoriesDiff, jRadioButtonNodeCategoriesSame});

        jPanelNodesLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabelNodeArchECPIdleState, jLabelNodeArchECPProcessing, jLabelNodeArchECPReception, jLabelNodeArchECPTransmission, jTextFieldNodeArchECPIdleState, jTextFieldNodeArchECPProcessing, jTextFieldNodeArchECPReception, jTextFieldNodeArchECPTransmission});

        jPanelNodesLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jComboBoxNodeMobModGrid, jComboBoxNodeMobModMaxVelocity, jLabelNodeMobModGrid, jLabelNodeMobModMaxVelocity});

        jPanelNodesLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jRadioButtonNodeMobModRPGMInplace, jRadioButtonNodeMobModRPGMOverlap});

        jTabbedPaneOptions.addTab("Nodes", jPanelNodes);

        jLabelRadioSpace.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabelRadioSpace.setText("Space definition :");

        buttonGroupRadioSpace.add(jRadioButtonRadioSpaceClearSky);
        jRadioButtonRadioSpaceClearSky.setSelected(true);
        jRadioButtonRadioSpaceClearSky.setText("Clear sky conditions");
        jRadioButtonRadioSpaceClearSky.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButtonRadioSpaceClearSkyActionPerformed(evt);
            }
        });

        buttonGroupRadioSpace.add(jRadioButtonRadioSpaceRain);
        jRadioButtonRadioSpaceRain.setText("Rain conditions");
        jRadioButtonRadioSpaceRain.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButtonRadioSpaceRainActionPerformed(evt);
            }
        });

        jButtonRadioSpace.setText("Set space conditions");
        jButtonRadioSpace.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonRadioSpaceActionPerformed(evt);
            }
        });

        jTextFieldRadioSpaceRainHeavy.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldRadioSpaceRainHeavy.setText("1000");
        jTextFieldRadioSpaceRainHeavy.setEnabled(false);
        jTextFieldRadioSpaceRainHeavy.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldRadioSpaceRainHeavyMouseClicked(evt);
            }
        });

        jLabelRadioSpaceRainHeavy.setText("Heavy rain attenuation (dB/km) :");
        jLabelRadioSpaceRainHeavy.setEnabled(false);

        jLabelRadioSpaceRainLight.setText("Light rain attenuation (dB/km) :");
        jLabelRadioSpaceRainLight.setEnabled(false);

        jTextFieldRadioSpaceRainLight.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldRadioSpaceRainLight.setText("500");
        jTextFieldRadioSpaceRainLight.setEnabled(false);
        jTextFieldRadioSpaceRainLight.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldRadioSpaceRainLightMouseClicked(evt);
            }
        });

        jLabelRadioFragmentation.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabelRadioFragmentation.setText("Space fragmentation :");
        jLabelRadioFragmentation.setEnabled(false);

        jTextFieldRadioFragmentationWidthCellsRain.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldRadioFragmentationWidthCellsRain.setText("20");
        jTextFieldRadioFragmentationWidthCellsRain.setEnabled(false);
        jTextFieldRadioFragmentationWidthCellsRain.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldRadioFragmentationWidthCellsRainMouseClicked(evt);
            }
        });

        jLabelRadioFragmentationHeightCellsRain.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelRadioFragmentationHeightCellsRain.setText("height :");
        jLabelRadioFragmentationHeightCellsRain.setEnabled(false);

        jTextFieldRadioFragmentationHeightCellsRain.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextFieldRadioFragmentationHeightCellsRain.setText("20");
        jTextFieldRadioFragmentationHeightCellsRain.setEnabled(false);
        jTextFieldRadioFragmentationHeightCellsRain.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextFieldRadioFragmentationHeightCellsRainMouseClicked(evt);
            }
        });

        jLabelRadioFragmentationWidthCellsRain.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelRadioFragmentationWidthCellsRain.setText("width :");
        jLabelRadioFragmentationWidthCellsRain.setEnabled(false);

        jSeparatorRadio.setOrientation(javax.swing.SwingConstants.VERTICAL);

        jLabelRadioAttMod.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabelRadioAttMod.setText("Attenuation model :");

        buttonGroupRadioAttenuationModel.add(jRadioButtonRadioAttModFSP);
        jRadioButtonRadioAttModFSP.setSelected(true);
        jRadioButtonRadioAttModFSP.setText("Free Space Path");

        buttonGroupRadioAttenuationModel.add(jRadioButtonRadioAttModFriisBasic);
        jRadioButtonRadioAttModFriisBasic.setText("Basic form of Friis Transmission Equation");

        buttonGroupRadioAttenuationModel.add(jRadioButtonRadioAttModFriisEmp);
        jRadioButtonRadioAttModFriisEmp.setText("Empirical modification of Friis Transmission Equation"); // NOI18N

        jLabel2.setText("Gt :");
        jLabel2.setEnabled(false);

        jTextField1.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextField1.setText("1");
        jTextField1.setEnabled(false);

        jLabel3.setText("Gr :");
        jLabel3.setEnabled(false);

        jTextField2.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextField2.setText("1");
        jTextField2.setEnabled(false);

        jLabel4.setText("n :");
        jLabel4.setEnabled(false);

        jTextField3.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextField3.setText("4");
        jTextField3.setEnabled(false);

        javax.swing.GroupLayout jPanelRadioLayout = new javax.swing.GroupLayout(jPanelRadio);
        jPanelRadio.setLayout(jPanelRadioLayout);
        jPanelRadioLayout.setHorizontalGroup(
            jPanelRadioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelRadioLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelRadioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelRadioLayout.createSequentialGroup()
                        .addComponent(jLabelRadioSpace)
                        .addGap(152, 152, 152))
                    .addGroup(jPanelRadioLayout.createSequentialGroup()
                        .addGroup(jPanelRadioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelRadioLayout.createSequentialGroup()
                                .addComponent(jButtonRadioSpace, javax.swing.GroupLayout.DEFAULT_SIZE, 132, Short.MAX_VALUE)
                                .addGap(108, 108, 108))
                            .addGroup(jPanelRadioLayout.createSequentialGroup()
                                .addGap(21, 21, 21)
                                .addGroup(jPanelRadioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(jPanelRadioLayout.createSequentialGroup()
                                        .addComponent(jLabelRadioSpaceRainHeavy)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextFieldRadioSpaceRainHeavy))
                                    .addGroup(jPanelRadioLayout.createSequentialGroup()
                                        .addComponent(jLabelRadioSpaceRainLight)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextFieldRadioSpaceRainLight, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGap(0, 0, 0))
                            .addGroup(jPanelRadioLayout.createSequentialGroup()
                                .addGroup(jPanelRadioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabelRadioFragmentation)
                                    .addGroup(jPanelRadioLayout.createSequentialGroup()
                                        .addComponent(jLabelRadioFragmentationWidthCellsRain, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextFieldRadioFragmentationWidthCellsRain, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE)
                                        .addComponent(jLabelRadioFragmentationHeightCellsRain)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextFieldRadioFragmentationHeightCellsRain, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGap(78, 78, 78)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jSeparatorRadio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelRadioLayout.createSequentialGroup()
                        .addGroup(jPanelRadioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jRadioButtonRadioSpaceRain, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jRadioButtonRadioSpaceClearSky, javax.swing.GroupLayout.Alignment.LEADING))
                        .addGap(116, 116, 116)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRadioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelRadioAttMod)
                    .addGroup(jPanelRadioLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addGroup(jPanelRadioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jRadioButtonRadioAttModFriisBasic)
                            .addComponent(jRadioButtonRadioAttModFSP)
                            .addComponent(jRadioButtonRadioAttModFriisEmp, javax.swing.GroupLayout.PREFERRED_SIZE, 288, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanelRadioLayout.createSequentialGroup()
                                .addComponent(jLabel2)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel3)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel4)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addContainerGap(11, Short.MAX_VALUE))
        );

        jPanelRadioLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jTextFieldRadioFragmentationHeightCellsRain, jTextFieldRadioFragmentationWidthCellsRain});

        jPanelRadioLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jRadioButtonRadioAttModFSP, jRadioButtonRadioAttModFriisBasic, jRadioButtonRadioAttModFriisEmp});

        jPanelRadioLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jTextFieldRadioSpaceRainHeavy, jTextFieldRadioSpaceRainLight});

        jPanelRadioLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jTextField1, jTextField2, jTextField3});

        jPanelRadioLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jButtonRadioSpace, jRadioButtonRadioSpaceClearSky, jRadioButtonRadioSpaceRain});

        jPanelRadioLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabelRadioSpaceRainHeavy, jLabelRadioSpaceRainLight});

        jPanelRadioLayout.setVerticalGroup(
            jPanelRadioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelRadioLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabelRadioSpace)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jRadioButtonRadioSpaceClearSky)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jRadioButtonRadioSpaceRain)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRadioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelRadioSpaceRainHeavy)
                    .addComponent(jTextFieldRadioSpaceRainHeavy, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRadioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelRadioSpaceRainLight)
                    .addComponent(jTextFieldRadioSpaceRainLight, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabelRadioFragmentation)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelRadioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelRadioFragmentationWidthCellsRain, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldRadioFragmentationWidthCellsRain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelRadioFragmentationHeightCellsRain)
                    .addComponent(jTextFieldRadioFragmentationHeightCellsRain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jButtonRadioSpace)
                .addContainerGap(72, Short.MAX_VALUE))
            .addComponent(jSeparatorRadio, javax.swing.GroupLayout.DEFAULT_SIZE, 285, Short.MAX_VALUE)
            .addGroup(jPanelRadioLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabelRadioAttMod)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jRadioButtonRadioAttModFSP)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jRadioButtonRadioAttModFriisBasic)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jRadioButtonRadioAttModFriisEmp)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 85, Short.MAX_VALUE)
                .addGroup(jPanelRadioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3)
                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4)
                    .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(84, 84, 84))
        );

        jPanelRadioLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel2, jTextField1});

        jPanelRadioLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jTextFieldRadioFragmentationHeightCellsRain, jTextFieldRadioFragmentationWidthCellsRain});

        jPanelRadioLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabelRadioSpaceRainHeavy, jLabelRadioSpaceRainLight, jTextFieldRadioSpaceRainHeavy, jTextFieldRadioSpaceRainLight});

        jTabbedPaneOptions.addTab("Radio propagation", jPanelRadio);

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel1.setText("Routing model :");

        jRadioButton1.setSelected(true);
        jRadioButton1.setText("Flood");

        javax.swing.GroupLayout jPanelRoutingLayout = new javax.swing.GroupLayout(jPanelRouting);
        jPanelRouting.setLayout(jPanelRoutingLayout);
        jPanelRoutingLayout.setHorizontalGroup(
            jPanelRoutingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelRoutingLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelRoutingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelRoutingLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(jRadioButton1))
                    .addComponent(jLabel1))
                .addContainerGap(473, Short.MAX_VALUE))
        );
        jPanelRoutingLayout.setVerticalGroup(
            jPanelRoutingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelRoutingLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jRadioButton1)
                .addContainerGap(235, Short.MAX_VALUE))
        );

        jTabbedPaneOptions.addTab("Routing", jPanelRouting);

        jLabelLogo.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabelLogo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelLogo.setText("WNSIM © 2009 ");

        javax.swing.GroupLayout jPanelOptionsLayout = new javax.swing.GroupLayout(jPanelOptions);
        jPanelOptions.setLayout(jPanelOptionsLayout);
        jPanelOptionsLayout.setHorizontalGroup(
            jPanelOptionsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelOptionsLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelOptionsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelOptionsLayout.createSequentialGroup()
                        .addComponent(jLabelLogo)
                        .addContainerGap(11, Short.MAX_VALUE))
                    .addGroup(jPanelOptionsLayout.createSequentialGroup()
                        .addComponent(jTabbedPaneOptions, javax.swing.GroupLayout.DEFAULT_SIZE, 576, Short.MAX_VALUE)
                        .addGap(11, 11, 11))))
        );

        jPanelOptionsLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabelLogo, jTabbedPaneOptions});

        jPanelOptionsLayout.setVerticalGroup(
            jPanelOptionsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelOptionsLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPaneOptions, javax.swing.GroupLayout.PREFERRED_SIZE, 313, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabelLogo, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        fileMenu.setMnemonic('F');
        fileMenu.setText("File");

        openMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK));
        openMenuItem.setMnemonic('O');
        openMenuItem.setText("Open");
        openMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                openMenuItemActionPerformed(evt);
            }
        });
        fileMenu.add(openMenuItem);

        saveMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
        saveMenuItem.setMnemonic('S');
        saveMenuItem.setText("Save");
        saveMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveMenuItemActionPerformed(evt);
            }
        });
        fileMenu.add(saveMenuItem);

        saveAsMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F12, 0));
        saveAsMenuItem.setMnemonic('A');
        saveAsMenuItem.setText("Save As ...");
        saveAsMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveAsMenuItemActionPerformed(evt);
            }
        });
        fileMenu.add(saveAsMenuItem);

        exitMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4, java.awt.event.InputEvent.ALT_MASK));
        exitMenuItem.setMnemonic('x');
        exitMenuItem.setText("Exit");
        exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitMenuItemActionPerformed(evt);
            }
        });
        fileMenu.add(exitMenuItem);

        menuBar.add(fileMenu);

        simulationMenu.setMnemonic('S');
        simulationMenu.setText("Simulation");

        jMenuItemSimulationRun.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.SHIFT_MASK));
        jMenuItemSimulationRun.setMnemonic('R');
        jMenuItemSimulationRun.setText("Run...");
        jMenuItemSimulationRun.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemSimulationRunActionPerformed(evt);
            }
        });
        simulationMenu.add(jMenuItemSimulationRun);

        menuBar.add(simulationMenu);

        helpMenu.setMnemonic('H');
        helpMenu.setText("Help");

        contentsMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0));
        contentsMenuItem.setMnemonic('C');
        contentsMenuItem.setText("Contents");
        helpMenu.add(contentsMenuItem);

        aboutMenuItem.setMnemonic('b');
        aboutMenuItem.setText("About");
        helpMenu.add(aboutMenuItem);

        menuBar.add(helpMenu);

        setJMenuBar(menuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanelOptions, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanelOptions, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuItemActionPerformed
        System.exit(0);
    }//GEN-LAST:event_exitMenuItemActionPerformed

    private void jMenuItemSimulationRunActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemSimulationRunActionPerformed
        storeOptions();
        SimulationPaintFrame spf = new SimulationPaintFrame(GUIOptionManager.getMapWidthMeters(), GUIOptionManager.getMapHeightMeters());
        dispose();
    }//GEN-LAST:event_jMenuItemSimulationRunActionPerformed

    private void saveAsMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveAsMenuItemActionPerformed
        storeOptions();
        JFileChooser chooser = new JFileChooser();
        String cdpath = null;
        try {
            cdpath = new java.io.File(".").getCanonicalPath() + "\\src\\config";
        } catch (IOException ex) {
            Logger.getLogger(WNSimGuideMainFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
        chooser.setCurrentDirectory(new File(cdpath));
        int option = chooser.showSaveDialog(this);
        //if Save button is clicked
        if (option == JFileChooser.APPROVE_OPTION) {
            File file = chooser.getSelectedFile();
            String filename = file.getName();
            if (filename.endsWith(".config")) {
                filename = filename.substring(0, filename.lastIndexOf("."));
            }
            ConfigXMLManager manager = new ConfigXMLManager(filename);
            manager.saveConfig();
        }
    }//GEN-LAST:event_saveAsMenuItemActionPerformed

    private void openMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openMenuItemActionPerformed
        JFileChooser chooser = new JFileChooser();
        String cdpath = null;
        try {
            cdpath = new java.io.File(".").getCanonicalPath() + "\\src\\config";
        } catch (IOException ex) {
            Logger.getLogger(WNSimGuideMainFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
        chooser.setCurrentDirectory(new File(cdpath));
        int option = chooser.showOpenDialog(this);
        //if Open button is clicked
        if (option == JFileChooser.APPROVE_OPTION) {
            File file = chooser.getSelectedFile();
            String filename = file.getName();
            if (filename.endsWith(".config")) {
                filename = filename.substring(0, filename.lastIndexOf("."));
            }
            ConfigXMLManager manager = new ConfigXMLManager(filename);
            manager.loadConfig();
            loadOptions();
        }
    }//GEN-LAST:event_openMenuItemActionPerformed

    private void saveMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveMenuItemActionPerformed
        storeOptions();
        ConfigXMLManager manager = new ConfigXMLManager("dummy");
        manager.saveConfig();
    }//GEN-LAST:event_saveMenuItemActionPerformed

    private void jTextFieldRadioFragmentationHeightCellsRainMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldRadioFragmentationHeightCellsRainMouseClicked
        // TODO add your handling code here:
}//GEN-LAST:event_jTextFieldRadioFragmentationHeightCellsRainMouseClicked

    private void jTextFieldRadioFragmentationWidthCellsRainMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldRadioFragmentationWidthCellsRainMouseClicked
        // TODO add your handling code here:
}//GEN-LAST:event_jTextFieldRadioFragmentationWidthCellsRainMouseClicked

    private void jTextFieldRadioSpaceRainLightMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldRadioSpaceRainLightMouseClicked
        jTextFieldRadioSpaceRainLight.setText(null);
}//GEN-LAST:event_jTextFieldRadioSpaceRainLightMouseClicked

    private void jTextFieldRadioSpaceRainHeavyMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldRadioSpaceRainHeavyMouseClicked
        jTextFieldRadioSpaceRainHeavy.setText(null);
}//GEN-LAST:event_jTextFieldRadioSpaceRainHeavyMouseClicked

    private void jButtonRadioSpaceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRadioSpaceActionPerformed
        if (jRadioButtonRadioSpaceClearSky.isSelected()) {
            GUIOptionManager.setRain(null);
        } else if (jRadioButtonRadioSpaceRain.isSelected()) {
            //check frequency - absorption is considerable mainly over 10GHz
            if (Integer.parseInt(jTextFieldGeneralFrequency.getText().trim()) < 10000) {
                JOptionPane.showMessageDialog(this, "Rain attenuation is inconsiderable under 10GHz.", "NOTIFICATION", JOptionPane.INFORMATION_MESSAGE);
            } else {
                GUIOptionManager.setHeavyAttenuation(Integer.parseInt(jTextFieldRadioSpaceRainHeavy.getText().trim()));
                GUIOptionManager.setLightAttenuation(Integer.parseInt(jTextFieldRadioSpaceRainLight.getText().trim()));
                int width = Integer.parseInt(jTextFieldRadioFragmentationWidthCellsRain.getText().trim());
                int height = Integer.parseInt(jTextFieldRadioFragmentationHeightCellsRain.getText().trim());
                GUIOptionManager.setMapWidthRain(width);
                GUIOptionManager.setMapHeightRain(height);
                RainPaintFrame rpf = new RainPaintFrame(width, height);
            }
        }
}//GEN-LAST:event_jButtonRadioSpaceActionPerformed

    private void jRadioButtonRadioSpaceRainActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonRadioSpaceRainActionPerformed
        jLabelRadioSpaceRainHeavy.setEnabled(true);
        jTextFieldRadioSpaceRainHeavy.setEnabled(true);
        jLabelRadioSpaceRainLight.setEnabled(true);
        jTextFieldRadioSpaceRainLight.setEnabled(true);
        jLabelRadioFragmentation.setEnabled(true);
        jLabelRadioFragmentationWidthCellsRain.setEnabled(true);
        jTextFieldRadioFragmentationWidthCellsRain.setEnabled(true);
        jLabelRadioFragmentationHeightCellsRain.setEnabled(true);
        jTextFieldRadioFragmentationHeightCellsRain.setEnabled(true);
}//GEN-LAST:event_jRadioButtonRadioSpaceRainActionPerformed

    private void jRadioButtonRadioSpaceClearSkyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonRadioSpaceClearSkyActionPerformed
        jLabelRadioSpaceRainHeavy.setEnabled(false);
        jTextFieldRadioSpaceRainHeavy.setEnabled(false);
        jLabelRadioSpaceRainLight.setEnabled(false);
        jTextFieldRadioSpaceRainLight.setEnabled(false);
        jLabelRadioFragmentation.setEnabled(false);
        jLabelRadioFragmentationWidthCellsRain.setEnabled(false);
        jTextFieldRadioFragmentationWidthCellsRain.setEnabled(false);
        jLabelRadioFragmentationHeightCellsRain.setEnabled(false);
        jTextFieldRadioFragmentationHeightCellsRain.setEnabled(false);
}//GEN-LAST:event_jRadioButtonRadioSpaceClearSkyActionPerformed

    private void jRadioButtonNodeMobModRPGMActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonNodeMobModRPGMActionPerformed
        jRadioButtonNodeMobModRPGMInplace.setEnabled(true);
        jRadioButtonNodeMobModRPGMOverlap.setEnabled(true);
        jLabelNodeMobModGrid.setEnabled(true);
        jComboBoxNodeMobModGrid.setEnabled(true);
}//GEN-LAST:event_jRadioButtonNodeMobModRPGMActionPerformed

    private void jRadioButtonNodeMobModRandomWaypointActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonNodeMobModRandomWaypointActionPerformed
        jRadioButtonNodeMobModRPGMInplace.setEnabled(false);
        jRadioButtonNodeMobModRPGMOverlap.setEnabled(false);
        jLabelNodeMobModGrid.setEnabled(false);
        jComboBoxNodeMobModGrid.setEnabled(false);
}//GEN-LAST:event_jRadioButtonNodeMobModRandomWaypointActionPerformed

    private void jTextFieldNodeArchAntennaRadPowMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldNodeArchAntennaRadPowMouseClicked
        jTextFieldNodeArchAntennaRadPow.setText(null);
}//GEN-LAST:event_jTextFieldNodeArchAntennaRadPowMouseClicked

    private void jTextFieldNodeArchAntennaThresMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldNodeArchAntennaThresMouseClicked
        jTextFieldNodeArchAntennaThres.setText(null);
}//GEN-LAST:event_jTextFieldNodeArchAntennaThresMouseClicked

    private void jTextFieldNodeArchECPReceptionMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldNodeArchECPReceptionMouseClicked
        jTextFieldNodeArchECPReception.setText(null);
}//GEN-LAST:event_jTextFieldNodeArchECPReceptionMouseClicked

    private void jTextFieldNodeArchECPProcessingMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldNodeArchECPProcessingMouseClicked
        jTextFieldNodeArchECPProcessing.setText(null);
}//GEN-LAST:event_jTextFieldNodeArchECPProcessingMouseClicked

    private void jTextFieldNodeArchECPIdleStateMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldNodeArchECPIdleStateMouseClicked
        jTextFieldNodeArchECPIdleState.setText(null);
}//GEN-LAST:event_jTextFieldNodeArchECPIdleStateMouseClicked

    private void jTextFieldNodeArchECPTransmissionMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldNodeArchECPTransmissionMouseClicked
        jTextFieldNodeArchECPTransmission.setText(null);
}//GEN-LAST:event_jTextFieldNodeArchECPTransmissionMouseClicked

    private void jTextFieldNodeArchECPMovementMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldNodeArchECPMovementMouseClicked
        jTextFieldNodeArchECPMovement.setText(null);
}//GEN-LAST:event_jTextFieldNodeArchECPMovementMouseClicked

    private void jComboBoxNodeCategoriesDiffItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jComboBoxNodeCategoriesDiffItemStateChanged
        jProgressBarNodeCategories.setMinimum(0);
        jProgressBarNodeCategories.setMaximum(jComboBoxNodeCategoriesDiff.getSelectedIndex() + 2);
        jProgressBarNodeCategories.setValue(0);
        jProgressBarNodeCategories.setString(0 + "%");
        v.removeAllElements();
        String[] nodesSet = jLabelNodeArchNodesLeft.getText().split("/");
        jLabelNodeArchNodesLeft.setText("0/" + nodesSet[1]);
        jTextFieldNodeArchNumberOfNodes.setText(null);
        jTextFieldNodeArchPowerV.setText("1.2");
        jTextFieldNodeArchPowermAh.setText("500");
        jCheckBoxNodesArchMobility.setSelected(false);
        jTextFieldNodeArchECPMovement.setText("5");
        jTextFieldNodeArchECPMovement.setEnabled(false);
        jTextFieldNodeArchECPIdleState.setText("2");
        jTextFieldNodeArchECPTransmission.setText("3");
        jTextFieldNodeArchECPReception.setText("1");
        jTextFieldNodeArchECPProcessing.setText("2");
        jTextFieldNodesArchDaemonInterval.setText("60");
        jTextFieldNodeArchAntennaRadPow.setText("0");
        jTextFieldNodeArchAntennaThres.setText("-70");
}//GEN-LAST:event_jComboBoxNodeCategoriesDiffItemStateChanged

    private void jTextFieldNodesArchDaemonIntervalMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldNodesArchDaemonIntervalMouseClicked
        jTextFieldNodesArchDaemonInterval.setText(null);
}//GEN-LAST:event_jTextFieldNodesArchDaemonIntervalMouseClicked

    private void jCheckBoxNodesArchMobilityActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxNodesArchMobilityActionPerformed
        if (jCheckBoxNodesArchMobility.isSelected()) {
            jLabelNodeArchECPMovement.setEnabled(true);
            jTextFieldNodeArchECPMovement.setEnabled(true);
        } else {
            jLabelNodeArchECPMovement.setEnabled(false);
            jTextFieldNodeArchECPMovement.setEnabled(false);
        }
}//GEN-LAST:event_jCheckBoxNodesArchMobilityActionPerformed

    private void jButtonNodeArchSetParamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNodeArchSetParamActionPerformed
        if (jRadioButtonNodeCategoriesSame.isSelected()) {
            jProgressBarNodeCategories.setValue(1);
            jProgressBarNodeCategories.setString(100 + "%");
            NodeArchBean nab = new NodeArchBean(Integer.parseInt(jTextFieldGeneralTotalNodes.getText()), Float.parseFloat(jTextFieldNodeArchPowerV.getText()) * Float.parseFloat(jTextFieldNodeArchPowermAh.getText()), jCheckBoxNodesArchMobility.isSelected(), Float.parseFloat(jTextFieldNodeArchECPMovement.getText()), Float.parseFloat(jTextFieldNodeArchECPIdleState.getText()), Float.parseFloat(jTextFieldNodeArchECPTransmission.getText()), Float.parseFloat(jTextFieldNodeArchECPReception.getText()), Float.parseFloat(jTextFieldNodeArchECPProcessing.getText()), Integer.parseInt(jTextFieldNodesArchDaemonInterval.getText()), Float.parseFloat(jTextFieldNodeArchAntennaRadPow.getText()), Float.parseFloat(jTextFieldNodeArchAntennaThres.getText()));
            v.addElement(nab);
            GUIOptionManager.setNodeArchPerCategory(v);
            GUIOptionManager.setNodeCategories(1);
            jButtonPositionNodesSet.setEnabled(true);
            jButtonNodeArchSetParam.setEnabled(false);
        } else {
            if (jProgressBarNodeCategories.getValue() < jComboBoxNodeCategoriesDiff.getSelectedIndex() + 2) {
                jProgressBarNodeCategories.setValue(jProgressBarNodeCategories.getValue() + 1);
                jProgressBarNodeCategories.setString((int) ((double) jProgressBarNodeCategories.getValue() / (jComboBoxNodeCategoriesDiff.getSelectedIndex() + 2) * 100) + "%");
                NodeArchBean nab = new NodeArchBean(Integer.parseInt(jTextFieldNodeArchNumberOfNodes.getText()), Float.parseFloat(jTextFieldNodeArchPowerV.getText()) * Float.parseFloat(jTextFieldNodeArchPowermAh.getText()), jCheckBoxNodesArchMobility.isSelected(), Float.parseFloat(jTextFieldNodeArchECPMovement.getText()), Float.parseFloat(jTextFieldNodeArchECPIdleState.getText()), Float.parseFloat(jTextFieldNodeArchECPTransmission.getText()), Float.parseFloat(jTextFieldNodeArchECPReception.getText()), Float.parseFloat(jTextFieldNodeArchECPProcessing.getText()), Integer.parseInt(jTextFieldNodesArchDaemonInterval.getText()), Float.parseFloat(jTextFieldNodeArchAntennaRadPow.getText()), Float.parseFloat(jTextFieldNodeArchAntennaThres.getText()));
                v.addElement(nab);
                String[] nodesSet = jLabelNodeArchNodesLeft.getText().split("/");
                jLabelNodeArchNodesLeft.setText((Integer.parseInt(nodesSet[0]) + Integer.parseInt(jTextFieldNodeArchNumberOfNodes.getText())) + "/" + nodesSet[1]);
                jTextFieldNodeArchNumberOfNodes.setText(null);
                jTextFieldNodeArchPowerV.setText("1.2");
                jTextFieldNodeArchPowermAh.setText("500");
                jCheckBoxNodesArchMobility.setSelected(false);
                jTextFieldNodeArchECPMovement.setText("5");
                jTextFieldNodeArchECPMovement.setEnabled(false);
                jTextFieldNodeArchECPIdleState.setText("2");
                jTextFieldNodeArchECPTransmission.setText("3");
                jTextFieldNodeArchECPReception.setText("1");
                jTextFieldNodeArchECPProcessing.setText("2");
                jTextFieldNodesArchDaemonInterval.setText("60");
                jTextFieldNodeArchAntennaRadPow.setText("0");
                jTextFieldNodeArchAntennaThres.setText("-70");
            }
            if (jProgressBarNodeCategories.getValue() == jComboBoxNodeCategoriesDiff.getSelectedIndex() + 2) {
                String[] nodesSet = jLabelNodeArchNodesLeft.getText().split("/");
                if (Integer.parseInt(nodesSet[0]) == Integer.parseInt(nodesSet[1])) {
                    GUIOptionManager.setNodeArchPerCategory(v);
                    GUIOptionManager.setNodeCategories(jComboBoxNodeCategoriesDiff.getSelectedIndex() + 2);
                    jButtonPositionNodesSet.setEnabled(true);
                    jButtonNodeArchSetParam.setEnabled(false);
                } else {
                    String[] categories = new String[jComboBoxNodeCategoriesDiff.getSelectedIndex() + 2];
                    for (int i = 0; i < categories.length; i++) {
                        categories[i] = "category " + (i + 1);
                    }
                    JPanel panel = new JPanel();
                    panel.setLayout(new GridLayout(2, 1));
                    panel.add(new Label("Incompatible declaration in number of nodes."));
                    panel.add(new Label("Adjust to the following category: "));
                    String option = (String) JOptionPane.showInputDialog(this, panel, "ERROR", JOptionPane.ERROR_MESSAGE, null, categories, categories[0]);
                    if (option == null) {
                        v.removeAllElements();
                        jProgressBarNodeCategories.setValue(0);
                        jProgressBarNodeCategories.setString(0 + "%");
                        jLabelNodeArchNodesLeft.setText("0/" + nodesSet[1]);
                        jTextFieldNodeArchNumberOfNodes.setText(null);
                        jTextFieldNodeArchPowerV.setText("1.2");
                        jTextFieldNodeArchPowermAh.setText("500");
                        jCheckBoxNodesArchMobility.setSelected(false);
                        jTextFieldNodeArchECPMovement.setText("5");
                        jTextFieldNodeArchECPMovement.setEnabled(false);
                        jTextFieldNodeArchECPIdleState.setText("2");
                        jTextFieldNodeArchECPTransmission.setText("3");
                        jTextFieldNodeArchECPReception.setText("1");
                        jTextFieldNodeArchECPProcessing.setText("2");
                        jTextFieldNodesArchDaemonInterval.setText("60");
                        jTextFieldNodeArchAntennaRadPow.setText("0");
                        jTextFieldNodeArchAntennaThres.setText("-70");
                    } else {
                        v.get(Integer.parseInt(option.split(" ")[1]) - 1).setNumberOfNodes(v.get(Integer.parseInt(option.split(" ")[1]) - 1).getNumberOfNodes() + Integer.parseInt(nodesSet[1]) - Integer.parseInt(nodesSet[0]));
                        GUIOptionManager.setNodeArchPerCategory(v);
                        GUIOptionManager.setNodeCategories(jComboBoxNodeCategoriesDiff.getSelectedIndex() + 2);
                        jLabelNodeArchNodesLeft.setText(nodesSet[1] + "/" + nodesSet[1]);
                        jButtonPositionNodesSet.setEnabled(true);
                        jButtonNodeArchSetParam.setEnabled(false);
                    }
                }
            }
        }
}//GEN-LAST:event_jButtonNodeArchSetParamActionPerformed

    private void jRadioButtonNodeCategoriesDiffActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonNodeCategoriesDiffActionPerformed
        if (jRadioButtonNodeCategoriesDiff.isSelected()) {
            jLabelNodeArchNodesLeft.setText("0/" + jTextFieldGeneralTotalNodes.getText());
            jComboBoxNodeCategoriesDiff.setEnabled(true);
            jProgressBarNodeCategories.setMinimum(0);
            jProgressBarNodeCategories.setMaximum(jComboBoxNodeCategoriesDiff.getSelectedIndex() + 2);
            jProgressBarNodeCategories.setValue(0);
            jProgressBarNodeCategories.setString(0 + "%");
            v.removeAllElements();
            jLabelNodeArchNumberOfNodes.setEnabled(true);
            jTextFieldNodeArchNumberOfNodes.setText(null);
            jTextFieldNodeArchNumberOfNodes.setEnabled(true);
            jButtonPositionNodesSet.setEnabled(false);
            jButtonNodeArchSetParam.setEnabled(true);
        }
}//GEN-LAST:event_jRadioButtonNodeCategoriesDiffActionPerformed

    private void jRadioButtonNodeCategoriesSameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonNodeCategoriesSameActionPerformed
        if (jRadioButtonNodeCategoriesSame.isSelected()) {
            jLabelNodeArchNodesLeft.setText(null);
            jComboBoxNodeCategoriesDiff.setEnabled(false);
            jProgressBarNodeCategories.setMinimum(0);
            jProgressBarNodeCategories.setMaximum(1);
            jProgressBarNodeCategories.setValue(0);
            jProgressBarNodeCategories.setString(0 + "%");
            v.removeAllElements();
            jLabelNodeArchNumberOfNodes.setEnabled(false);
            jTextFieldNodeArchNumberOfNodes.setText(null);
            jTextFieldNodeArchNumberOfNodes.setEnabled(false);
            jButtonPositionNodesSet.setEnabled(false);
            jButtonNodeArchSetParam.setEnabled(true);
        }
}//GEN-LAST:event_jRadioButtonNodeCategoriesSameActionPerformed

    private void jButtonPositionNodesSetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonPositionNodesSetActionPerformed
        if (GUIOptionManager.getNodes() == null) {
            NodesPaintFrame npf = new NodesPaintFrame(GUIOptionManager.getMapWidthMeters(), GUIOptionManager.getMapHeightMeters(), GUIOptionManager.getNodeCategories(), GUIOptionManager.getMapWidthObstacles(), GUIOptionManager.getMapHeightObstacles(), GUIOptionManager.getObstacles());
        }
        else {
            JOptionPane.showMessageDialog(this, "Nodes have already been set.", "NOTIFICATION", JOptionPane.WARNING_MESSAGE);
        }
}//GEN-LAST:event_jButtonPositionNodesSetActionPerformed

    private void jTextFieldTerrainFragmentationHeightCellsObstaclesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldTerrainFragmentationHeightCellsObstaclesMouseClicked
        jTextFieldTerrainFragmentationHeightCellsObstacles.setText(null);
}//GEN-LAST:event_jTextFieldTerrainFragmentationHeightCellsObstaclesMouseClicked

    private void jTextFieldTerrainFragmentationWidthCellsObstaclesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldTerrainFragmentationWidthCellsObstaclesMouseClicked
        jTextFieldTerrainFragmentationWidthCellsObstacles.setText(null);
}//GEN-LAST:event_jTextFieldTerrainFragmentationWidthCellsObstaclesMouseClicked

    private void jTextFieldTerrainCapacityWidthMetersMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldTerrainCapacityWidthMetersMouseClicked
        jTextFieldTerrainCapacityWidthMeters.setText(null);
}//GEN-LAST:event_jTextFieldTerrainCapacityWidthMetersMouseClicked

    private void jTextFieldTerrainCapacityHeightMetersMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldTerrainCapacityHeightMetersMouseClicked
        jTextFieldTerrainCapacityHeightMeters.setText(null);
}//GEN-LAST:event_jTextFieldTerrainCapacityHeightMetersMouseClicked

    private void jRadioButtonTerrainDefinitionEmptySpaceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonTerrainDefinitionEmptySpaceActionPerformed
        jLabelTerrainCapacityWidthMeters.setEnabled(true);
        jTextFieldTerrainCapacityWidthMeters.setEnabled(true);
        jLabelTerrainCapacityHeightMeters.setEnabled(true);
        jTextFieldTerrainCapacityHeightMeters.setEnabled(true);
        jLabelTerrainFragmentation.setEnabled(false);
        jLabelTerrainFragmentationWidthCellsObstacles.setEnabled(false);
        jTextFieldTerrainFragmentationWidthCellsObstacles.setEnabled(false);
        jLabelTerrainFragmentationHeightCellsObstacles.setEnabled(false);
        jTextFieldTerrainFragmentationHeightCellsObstacles.setEnabled(false);
}//GEN-LAST:event_jRadioButtonTerrainDefinitionEmptySpaceActionPerformed

    private void jRadioButtonTerrainDefinitionCreateMapActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonTerrainDefinitionCreateMapActionPerformed
        jLabelTerrainCapacityWidthMeters.setEnabled(true);
        jTextFieldTerrainCapacityWidthMeters.setEnabled(true);
        jLabelTerrainCapacityHeightMeters.setEnabled(true);
        jTextFieldTerrainCapacityHeightMeters.setEnabled(true);
        jLabelTerrainFragmentation.setEnabled(true);
        jLabelTerrainFragmentationWidthCellsObstacles.setEnabled(true);
        jTextFieldTerrainFragmentationWidthCellsObstacles.setEnabled(true);
        jLabelTerrainFragmentationHeightCellsObstacles.setEnabled(true);
        jTextFieldTerrainFragmentationHeightCellsObstacles.setEnabled(true);
}//GEN-LAST:event_jRadioButtonTerrainDefinitionCreateMapActionPerformed

    private void jRadioButtonTerrainDefinitionLoadMapActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonTerrainDefinitionLoadMapActionPerformed
        jLabelTerrainCapacityWidthMeters.setEnabled(false);
        jTextFieldTerrainCapacityWidthMeters.setEnabled(false);
        jLabelTerrainCapacityHeightMeters.setEnabled(false);
        jTextFieldTerrainCapacityHeightMeters.setEnabled(false);
        jLabelTerrainFragmentation.setEnabled(false);
        jLabelTerrainFragmentationWidthCellsObstacles.setEnabled(false);
        jTextFieldTerrainFragmentationWidthCellsObstacles.setEnabled(false);
        jLabelTerrainFragmentationHeightCellsObstacles.setEnabled(false);
        jTextFieldTerrainFragmentationHeightCellsObstacles.setEnabled(false);
}//GEN-LAST:event_jRadioButtonTerrainDefinitionLoadMapActionPerformed

    private void jButtonTerrainDefinitionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonTerrainDefinitionActionPerformed
        if (jRadioButtonTerrainDefinitionEmptySpace.isSelected()) {
            GUIOptionManager.setMapWidthMeters(Integer.parseInt(jTextFieldTerrainCapacityWidthMeters.getText().trim()));
            GUIOptionManager.setMapHeightMeters(Integer.parseInt(jTextFieldTerrainCapacityHeightMeters.getText().trim()));
            loadMap(null);
            jLabelMap.setToolTipText("new empty map");
        } else if (jRadioButtonTerrainDefinitionLoadMap.isSelected()) {
            JFileChooser chooser = new JFileChooser();
            String cdpath = null;
            try {
                cdpath = new java.io.File(".").getCanonicalPath() + "\\src\\maps";
            } catch (IOException ex) {
                Logger.getLogger(WNSimGuideMainFrame.class.getName()).log(Level.SEVERE, null, ex);
            }
            chooser.setCurrentDirectory(new File(cdpath));
            int option = chooser.showOpenDialog(this);
            //if Open button is clicked
            if (option == JFileChooser.APPROVE_OPTION) {
                File file = chooser.getSelectedFile();
                MapsXMLManager manager = new MapsXMLManager(file.getName());
                Vector<DrawingBean> tempv = manager.loadMap();
                if (tempv == null) {
                    JOptionPane.showMessageDialog(null, "Sorry. This map does not exist.", "ERROR", JOptionPane.OK_OPTION);
                } else {
                    GUIOptionManager.setMapWidthMeters(manager.getCapacity().x);
                    GUIOptionManager.setMapHeightMeters(manager.getCapacity().y);
                    GUIOptionManager.setMapWidthObstacles(manager.getFragmentation().x);
                    GUIOptionManager.setMapHeightObstacles(manager.getFragmentation().y);
                    loadMap(tempv);
                    jLabelMap.setToolTipText(file.getName());
                }
            }
        } else if (jRadioButtonTerrainDefinitionCreateMap.isSelected()) {
            int width = Integer.parseInt(jTextFieldTerrainFragmentationWidthCellsObstacles.getText().trim());
            int height = Integer.parseInt(jTextFieldTerrainFragmentationHeightCellsObstacles.getText().trim());
            GUIOptionManager.setMapWidthMeters(Integer.parseInt(jTextFieldTerrainCapacityWidthMeters.getText().trim()));
            GUIOptionManager.setMapHeightMeters(Integer.parseInt(jTextFieldTerrainCapacityHeightMeters.getText().trim()));
            GUIOptionManager.setMapWidthObstacles(Integer.parseInt(jTextFieldTerrainFragmentationWidthCellsObstacles.getText().trim()));
            GUIOptionManager.setMapHeightObstacles(Integer.parseInt(jTextFieldTerrainFragmentationHeightCellsObstacles.getText().trim()));
            TerrainPaintFrame tpf = new TerrainPaintFrame(width, height);
            tpf.addPropertyChangeListener("v", new PropertyChangeListener() {

                public void propertyChange(PropertyChangeEvent evt) {
                    Vector<DrawingBean> v = (Vector<DrawingBean>) evt.getNewValue();
                    loadMap(v);
                    jLabelMap.setToolTipText("new/modified map");
                }
            });
        }
}//GEN-LAST:event_jButtonTerrainDefinitionActionPerformed

    private void jTextFieldGeneralTimeScaleProcessingMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldGeneralTimeScaleProcessingMouseClicked
        jTextFieldGeneralTimeScaleProcessing.setText(null);
}//GEN-LAST:event_jTextFieldGeneralTimeScaleProcessingMouseClicked

    private void jTextFieldGeneralTimeScaleTranceptionMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldGeneralTimeScaleTranceptionMouseClicked
        jTextFieldGeneralTimeScaleTranception.setText(null);
}//GEN-LAST:event_jTextFieldGeneralTimeScaleTranceptionMouseClicked

    private void jTextFieldGeneralTimeScale1secFieldMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldGeneralTimeScale1secFieldMouseClicked
        jTextFieldGeneralTimeScale1secField.setText(null);
}//GEN-LAST:event_jTextFieldGeneralTimeScale1secFieldMouseClicked

    private void jTextFieldGeneralFrequencyMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldGeneralFrequencyMouseClicked
        jTextFieldGeneralFrequency.setText(null);
}//GEN-LAST:event_jTextFieldGeneralFrequencyMouseClicked

    private void jCheckBoxGeneralNetworkingDistrSimActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxGeneralNetworkingDistrSimActionPerformed
        if (jCheckBoxGeneralNetworkingDistrSim.isSelected()) {
            jLabelGeneralNetworkingDistrSimIP.setEnabled(true);
            jTextFieldGeneralNetworkingDistrSimIP.setEnabled(true);
        } else {
            jLabelGeneralNetworkingDistrSimIP.setEnabled(false);
            jTextFieldGeneralNetworkingDistrSimIP.setEnabled(false);
        }
}//GEN-LAST:event_jCheckBoxGeneralNetworkingDistrSimActionPerformed

    private void jTextFieldGeneralSimTimeSecMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldGeneralSimTimeSecMouseClicked
        jTextFieldGeneralSimTimeSec.setText(null);
}//GEN-LAST:event_jTextFieldGeneralSimTimeSecMouseClicked

    private void jTextFieldGeneralTotalNodesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldGeneralTotalNodesMouseClicked
        jTextFieldGeneralTotalNodes.setText(null);
}//GEN-LAST:event_jTextFieldGeneralTotalNodesMouseClicked

    private void jTextFieldGeneralCommOffsetMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldGeneralCommOffsetMouseClicked
        jTextFieldGeneralCommOffset.setText(null);
}//GEN-LAST:event_jTextFieldGeneralCommOffsetMouseClicked

    private void jTextFieldGeneralSimTimeMinMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextFieldGeneralSimTimeMinMouseClicked
        jTextFieldGeneralSimTimeMin.setText(null);
}//GEN-LAST:event_jTextFieldGeneralSimTimeMinMouseClicked

    /**
     * Loads the chosen map from a list
     * @param v Vector with the mobility details
     */
    private void loadMap(Vector<DrawingBean> v) {
        GUIOptionManager.setObstacles(v);
        int terrain_width = GUIOptionManager.getMapWidthMeters();
        int terrain_height = GUIOptionManager.getMapHeightMeters();
        BufferedImage bi = new BufferedImage(terrain_width * MULT, terrain_height * MULT, BufferedImage.TYPE_INT_RGB);
        bi.createGraphics();
        Graphics2D g = (Graphics2D) bi.getGraphics();
        //set a white bachground
        g.setColor(Color.WHITE);
        g.fillRect(0, 0, terrain_width * MULT, terrain_height * MULT);
        //copy the map design to image
        if (v != null) {
            int cell_width = GUIOptionManager.getMapWidthMeters() / GUIOptionManager.getMapWidthObstacles();
            int cell_height = GUIOptionManager.getMapHeightMeters() / GUIOptionManager.getMapHeightObstacles();
            for (int i = 0; i < v.size(); i++) {
                g.setColor(v.get(i).getColor());
                g.fillRect(v.get(i).getPoint().x * cell_width * MULT, v.get(i).getPoint().y * cell_height * MULT, cell_width * MULT, cell_height * MULT);
            }
        }
        Image i = bi.getScaledInstance(jLabelMap.getWidth(), jLabelMap.getHeight(), Image.SCALE_DEFAULT);
        ImageIcon ii = new ImageIcon(i);
        jLabelMap.setText(null);
        jLabelMap.setIcon(ii);
        setVisible(true);
    }

    /**
     * Stores all selected options to GUIOptionManager
     */
    private void storeOptions() {
        //save all selected options
        GUIOptionManager.setCommOffset(Integer.parseInt(jTextFieldGeneralCommOffset.getText().trim()));
        GUIOptionManager.setTotalNodes(Integer.parseInt(jTextFieldGeneralTotalNodes.getText().trim()));
        GUIOptionManager.setSimTimeMin(Integer.parseInt(jTextFieldGeneralSimTimeMin.getText().trim()));
        GUIOptionManager.setSimTimeSec(Integer.parseInt(jTextFieldGeneralSimTimeSec.getText().trim()));
        GUIOptionManager.setSimTotalTimeInSec(GUIOptionManager.getSimTimeMin() * 60 + GUIOptionManager.getSimTimeSec());
        GUIOptionManager.setFrequency(Integer.parseInt(jTextFieldGeneralFrequency.getText().trim()));
        GUIOptionManager.setTimeScale(Integer.parseInt(jTextFieldGeneralTimeScale1secField.getText().trim()));
        GUIOptionManager.setTimeScaleTranception(Integer.parseInt(jTextFieldGeneralTimeScaleTranception.getText().trim()));
        GUIOptionManager.setTimeScaleProcessing(Integer.parseInt(jTextFieldGeneralTimeScaleProcessing.getText().trim()));
        if (jCheckBoxGeneralNetworkingDistrSim.isSelected()) {
            GUIOptionManager.setIp(jTextFieldGeneralNetworkingDistrSimIP.getText());
        } else {
            GUIOptionManager.setIp("127.0.0.1");
        }
        GUIOptionManager.setMapName(jLabelMap.getToolTipText());
        if (jRadioButtonNodeMobModRandomWaypoint.isSelected()) {
            GUIOptionManager.setRpgm(false);
        } else if (jRadioButtonNodeMobModRPGM.isSelected()) {
            GUIOptionManager.setRpgm(true);
            if (jRadioButtonNodeMobModRPGMInplace.isSelected()) {
                GUIOptionManager.setInplace(true);
            } else if (jRadioButtonNodeMobModRPGMOverlap.isSelected()) {
                GUIOptionManager.setInplace(false);
            }
            GUIOptionManager.setGrid(Integer.parseInt(jComboBoxNodeMobModGrid.getSelectedItem().toString()));
        }
        GUIOptionManager.setMaxVelocity(Integer.parseInt(jComboBoxNodeMobModMaxVelocity.getSelectedItem().toString()));
    }

    private void loadOptions() {
        //load all options
        jTextFieldGeneralCommOffset.setText("" + GUIOptionManager.getCommOffset());
        jTextFieldGeneralTotalNodes.setText("" + GUIOptionManager.getTotalNodes());
        jTextFieldGeneralFrequency.setText("" + GUIOptionManager.getFrequency());
        jTextFieldGeneralSimTimeMin.setText("" + GUIOptionManager.getSimTimeMin());
        jTextFieldGeneralSimTimeSec.setText("" + GUIOptionManager.getSimTimeSec());
        jTextFieldGeneralTimeScale1secField.setText("" + GUIOptionManager.getTimeScale());
        jTextFieldGeneralTimeScaleTranception.setText("" + GUIOptionManager.getTimeScaleTranception());
        jTextFieldGeneralTimeScaleProcessing.setText("" + GUIOptionManager.getTimeScaleProcessing());
        if (GUIOptionManager.getIp().equals("127.0.0.1")) {
            if (jCheckBoxGeneralNetworkingDistrSim.isSelected()) {
                jCheckBoxGeneralNetworkingDistrSim.doClick();
            }
        } else {
            if (!jCheckBoxGeneralNetworkingDistrSim.isSelected()) {
                jCheckBoxGeneralNetworkingDistrSim.doClick();
            }
            jTextFieldGeneralNetworkingDistrSimIP.setText(GUIOptionManager.getIp());
        }
        jRadioButtonTerrainDefinitionLoadMap.doClick();
        jTextFieldTerrainCapacityWidthMeters.setText("" + GUIOptionManager.getMapWidthMeters());
        jTextFieldTerrainCapacityHeightMeters.setText("" + GUIOptionManager.getMapHeightMeters());
        jTextFieldTerrainFragmentationWidthCellsObstacles.setText("" + GUIOptionManager.getMapWidthObstacles());
        jTextFieldTerrainFragmentationHeightCellsObstacles.setText("" + GUIOptionManager.getMapHeightObstacles());
        if (GUIOptionManager.getMapName() != null) {
            loadMap(GUIOptionManager.getObstacles());
            jLabelMap.setToolTipText(GUIOptionManager.getMapName());
        }
        if (GUIOptionManager.getNodeArchPerCategory() != null) {
            if (GUIOptionManager.getNodeArchPerCategory().size() == 1) {
                jRadioButtonNodeCategoriesSame.doClick();
            } else {
                jRadioButtonNodeCategoriesDiff.doClick();
                jComboBoxNodeCategoriesDiff.setSelectedIndex(GUIOptionManager.getNodeArchPerCategory().size() - 2);
            }
            if (GUIOptionManager.getNodes() != null) {
                jProgressBarNodeCategories.setValue(jProgressBarNodeCategories.getMaximum());
                jProgressBarNodeCategories.setString("100%");
                jButtonNodeArchSetParam.setEnabled(false);
                jButtonPositionNodesSet.setEnabled(true);
            } else {
                jProgressBarNodeCategories.setValue(jProgressBarNodeCategories.getMinimum());
                jProgressBarNodeCategories.setString("0%");
                jButtonNodeArchSetParam.setEnabled(true);
                jButtonPositionNodesSet.setEnabled(false);
            }
            if (!GUIOptionManager.isRpgm()) {
                jRadioButtonNodeMobModRandomWaypoint.doClick();
            } else {
                jRadioButtonNodeMobModRPGM.doClick();
                if (GUIOptionManager.isInplace()) {
                    jRadioButtonNodeMobModRPGMInplace.doClick();
                } else {
                    jRadioButtonNodeMobModRPGMOverlap.doClick();
                }
                jComboBoxNodeMobModGrid.setSelectedItem(GUIOptionManager.getGrid());
            }
            jComboBoxNodeMobModMaxVelocity.setSelectedIndex(GUIOptionManager.getMaxVelocity() - 1);
        }
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuItem aboutMenuItem;
    private javax.swing.ButtonGroup buttonGroupNodeCategories;
    private javax.swing.ButtonGroup buttonGroupNodeMobilityModel;
    private javax.swing.ButtonGroup buttonGroupNodeMobilityModelRPGM;
    private javax.swing.ButtonGroup buttonGroupRadioAttenuationModel;
    private javax.swing.ButtonGroup buttonGroupRadioSpace;
    private javax.swing.ButtonGroup buttonGroupTerrain;
    private javax.swing.JMenuItem contentsMenuItem;
    private javax.swing.JMenuItem exitMenuItem;
    private javax.swing.JMenu fileMenu;
    private javax.swing.JMenu helpMenu;
    private javax.swing.JButton jButtonNodeArchSetParam;
    private javax.swing.JButton jButtonPositionNodesSet;
    private javax.swing.JButton jButtonRadioSpace;
    private javax.swing.JButton jButtonTerrainDefinition;
    private javax.swing.JCheckBox jCheckBoxGeneralNetworkingDistrSim;
    private javax.swing.JCheckBox jCheckBoxNodesArchMobility;
    private javax.swing.JComboBox jComboBoxNodeCategoriesDiff;
    private javax.swing.JComboBox jComboBoxNodeMobModGrid;
    private javax.swing.JComboBox jComboBoxNodeMobModMaxVelocity;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabelGeneralCommOffset;
    private javax.swing.JLabel jLabelGeneralComment;
    private javax.swing.JLabel jLabelGeneralFrequency;
    private javax.swing.JLabel jLabelGeneralNetworking;
    private javax.swing.JLabel jLabelGeneralNetworkingDistrSimIP;
    private javax.swing.JLabel jLabelGeneralSimTime;
    private javax.swing.JLabel jLabelGeneralSimTimeMin1;
    private javax.swing.JLabel jLabelGeneralSimTimeSec;
    private javax.swing.JLabel jLabelGeneralTimeScale;
    private javax.swing.JLabel jLabelGeneralTimeScale1secField;
    private javax.swing.JLabel jLabelGeneralTimeScale1secSim;
    private javax.swing.JLabel jLabelGeneralTimeScaleProcessing;
    private javax.swing.JLabel jLabelGeneralTimeScaleTranception;
    private javax.swing.JLabel jLabelGeneralTotalNodes;
    private javax.swing.JLabel jLabelLogo;
    private javax.swing.JLabel jLabelMap;
    private javax.swing.JLabel jLabelNodeArch;
    private javax.swing.JLabel jLabelNodeArchAntennaRadPow;
    private javax.swing.JLabel jLabelNodeArchAntennaThres;
    private javax.swing.JLabel jLabelNodeArchComment;
    private javax.swing.JLabel jLabelNodeArchECPIdleState;
    private javax.swing.JLabel jLabelNodeArchECPMovement;
    private javax.swing.JLabel jLabelNodeArchECPProcessing;
    private javax.swing.JLabel jLabelNodeArchECPReception;
    private javax.swing.JLabel jLabelNodeArchECPTransmission;
    private javax.swing.JLabel jLabelNodeArchNodesLeft;
    private javax.swing.JLabel jLabelNodeArchNumberOfNodes;
    private javax.swing.JLabel jLabelNodeArchPower;
    private javax.swing.JLabel jLabelNodeArchPowerV;
    private javax.swing.JLabel jLabelNodeArchPowermAh;
    private javax.swing.JLabel jLabelNodeCategories;
    private javax.swing.JLabel jLabelNodeMobModGrid;
    private javax.swing.JLabel jLabelNodeMobModMaxVelocity;
    private javax.swing.JLabel jLabelNodeMobilityModel;
    private javax.swing.JLabel jLabelNodesArchDaemonInterval;
    private javax.swing.JLabel jLabelNodesArchDaemonIntervalSec;
    private javax.swing.JLabel jLabelPositionNodes;
    private javax.swing.JLabel jLabelRadioAttMod;
    private javax.swing.JLabel jLabelRadioFragmentation;
    private javax.swing.JLabel jLabelRadioFragmentationHeightCellsRain;
    private javax.swing.JLabel jLabelRadioFragmentationWidthCellsRain;
    private javax.swing.JLabel jLabelRadioSpace;
    private javax.swing.JLabel jLabelRadioSpaceRainHeavy;
    private javax.swing.JLabel jLabelRadioSpaceRainLight;
    private javax.swing.JLabel jLabelTerrainCapacity;
    private javax.swing.JLabel jLabelTerrainCapacityHeightMeters;
    private javax.swing.JLabel jLabelTerrainCapacityWidthMeters;
    private javax.swing.JLabel jLabelTerrainDefinition;
    private javax.swing.JLabel jLabelTerrainFragmentation;
    private javax.swing.JLabel jLabelTerrainFragmentationHeightCellsObstacles;
    private javax.swing.JLabel jLabelTerrainFragmentationWidthCellsObstacles;
    private javax.swing.JMenuItem jMenuItemSimulationRun;
    private javax.swing.JPanel jPanelGeneral;
    private javax.swing.JPanel jPanelMap;
    private javax.swing.JPanel jPanelNodes;
    private javax.swing.JPanel jPanelOptions;
    private javax.swing.JPanel jPanelRadio;
    private javax.swing.JPanel jPanelRouting;
    private javax.swing.JPanel jPanelTerrain;
    private javax.swing.JProgressBar jProgressBarNodeCategories;
    private javax.swing.JRadioButton jRadioButton1;
    private javax.swing.JRadioButton jRadioButtonNodeCategoriesDiff;
    private javax.swing.JRadioButton jRadioButtonNodeCategoriesSame;
    private javax.swing.JRadioButton jRadioButtonNodeMobModRPGM;
    private javax.swing.JRadioButton jRadioButtonNodeMobModRPGMInplace;
    private javax.swing.JRadioButton jRadioButtonNodeMobModRPGMOverlap;
    private javax.swing.JRadioButton jRadioButtonNodeMobModRandomWaypoint;
    private javax.swing.JRadioButton jRadioButtonRadioAttModFSP;
    private javax.swing.JRadioButton jRadioButtonRadioAttModFriisBasic;
    private javax.swing.JRadioButton jRadioButtonRadioAttModFriisEmp;
    private javax.swing.JRadioButton jRadioButtonRadioSpaceClearSky;
    private javax.swing.JRadioButton jRadioButtonRadioSpaceRain;
    private javax.swing.JRadioButton jRadioButtonTerrainDefinitionCreateMap;
    private javax.swing.JRadioButton jRadioButtonTerrainDefinitionEmptySpace;
    private javax.swing.JRadioButton jRadioButtonTerrainDefinitionLoadMap;
    private javax.swing.JSeparator jSeparatorGeneral;
    private javax.swing.JSeparator jSeparatorNode;
    private javax.swing.JSeparator jSeparatorRadio;
    private javax.swing.JTabbedPane jTabbedPaneOptions;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextFieldGeneralCommOffset;
    private javax.swing.JTextField jTextFieldGeneralFrequency;
    private javax.swing.JTextField jTextFieldGeneralNetworkingDistrSimIP;
    private javax.swing.JTextField jTextFieldGeneralSimTimeMin;
    private javax.swing.JTextField jTextFieldGeneralSimTimeSec;
    private javax.swing.JTextField jTextFieldGeneralTimeScale1secField;
    private javax.swing.JTextField jTextFieldGeneralTimeScaleProcessing;
    private javax.swing.JTextField jTextFieldGeneralTimeScaleTranception;
    private javax.swing.JTextField jTextFieldGeneralTotalNodes;
    private javax.swing.JTextField jTextFieldNodeArchAntennaRadPow;
    private javax.swing.JTextField jTextFieldNodeArchAntennaThres;
    private javax.swing.JTextField jTextFieldNodeArchECPIdleState;
    private javax.swing.JTextField jTextFieldNodeArchECPMovement;
    private javax.swing.JTextField jTextFieldNodeArchECPProcessing;
    private javax.swing.JTextField jTextFieldNodeArchECPReception;
    private javax.swing.JTextField jTextFieldNodeArchECPTransmission;
    private javax.swing.JTextField jTextFieldNodeArchNumberOfNodes;
    private javax.swing.JTextField jTextFieldNodeArchPowerV;
    private javax.swing.JTextField jTextFieldNodeArchPowermAh;
    private javax.swing.JTextField jTextFieldNodesArchDaemonInterval;
    private javax.swing.JTextField jTextFieldRadioFragmentationHeightCellsRain;
    private javax.swing.JTextField jTextFieldRadioFragmentationWidthCellsRain;
    private javax.swing.JTextField jTextFieldRadioSpaceRainHeavy;
    private javax.swing.JTextField jTextFieldRadioSpaceRainLight;
    private javax.swing.JTextField jTextFieldTerrainCapacityHeightMeters;
    private javax.swing.JTextField jTextFieldTerrainCapacityWidthMeters;
    private javax.swing.JTextField jTextFieldTerrainFragmentationHeightCellsObstacles;
    private javax.swing.JTextField jTextFieldTerrainFragmentationWidthCellsObstacles;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JMenuItem openMenuItem;
    private javax.swing.JMenuItem saveAsMenuItem;
    private javax.swing.JMenuItem saveMenuItem;
    private javax.swing.JMenu simulationMenu;
    // End of variables declaration//GEN-END:variables
}

